Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: colocate type in src/ #22

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"author": "Eric Liu (https://github.com/metonym)",
"svelte": "./src/index.js",
"main": "./src/index.js",
"types": "./types/index.d.ts",
"types": "./src/index.d.ts",
"scripts": {
"dev": "rollup -cw",
"predeploy": "rollup -c",
Expand Down Expand Up @@ -35,7 +35,6 @@
"combo"
],
"files": [
"src",
"types"
"src"
]
}
33 changes: 33 additions & 0 deletions src/Keydown.svelte.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import type { SvelteComponentTyped } from "svelte";

export interface KeydownProps {
/**
* Set to `true` to pause the capture of keydown events
* @default false
*/
paused?: boolean;

/**
* Set to `true` to pause keydown events when typing in an input field
* @default false
*/
pauseOnInput?: boolean;

/**
* Specify the separating key between multiple keys
* @default "-"
*/
separator?: string;
}

export default class Keydown extends SvelteComponentTyped<
KeydownProps,
{
combo: CustomEvent<string>;
key: CustomEvent<string>;
keyup: WindowEventMap["keyup"];
keydown: WindowEventMap["keydown"];
[key: string]: CustomEvent<any>;
},
{}
> {}
1 change: 1 addition & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import { default as Keydown } from "./Keydown.svelte";
4 changes: 1 addition & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import Keydown from "./Keydown.svelte";

export default Keydown;
import { default as Keydown } from "./Keydown.svelte";