-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Provide TypeScript types #464
Labels
Comments
Yes, please! I would also be open to authoring this addon in typescript. |
anyone have some local .d.ts file that we can paste in to the addon's directory? 😅 |
3 tasks
@NullVoxPopuli this is what I use currently // types/ember-keyboard/helpers/on-key.d.ts
import Helper from '@ember/component/helper';
export default class OnKeyHelper extends Helper<{
Args: {
Positional: [keyCombo: string, callback: (event: KeyboardEvent) => void];
};
Return: void;
}> {} // types/ember-keyboard/modifiers/on-key.d.ts
import Modifier from 'ember-modifier';
export default class OnKeyModifier extends Modifier<{
Args: {
Positional: [keyCombo: string, callback?: (event: KeyboardEvent) => void];
Named: {
activated?: boolean;
event?: string;
priority?: number;
onlyWhenFocused?: boolean;
};
};
Element: HTMLElement;
}> {} // types/ember-keyboard/test-support/test-helpers.d.ts
export function keyDown(keyCombo: string): Promise<void>;
export function keyUp(keyCombo: string): Promise<void>;
export function keyPress(keyCombo: string): Promise<void>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would be great if the addon would ship with its own
index.d.ts
types! 😀The text was updated successfully, but these errors were encountered: