Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fastkit/keyboard

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastkit/keyboard - npm Package Compare versions

Comparing version 0.12.8 to 0.12.9

./dist/keyboard.mjs

152

dist/keyboard.d.ts

@@ -1,39 +0,29 @@

export declare function CommonIME<T extends KeyTypeCommonIME | KeyTypeCommonIME[]>(key: T): T;
declare interface ComputedKBSetting {
target: GlobalEventHandlers;
event: KBEventName;
capture: boolean;
settings: KBSettings;
handler: (ev: KeyboardEvent) => void;
}
export declare function Editing<T extends KeyTypeEditing | KeyTypeEditing[]>(key: T): T;
declare function Function_2<T extends KeyTypeFunction | KeyTypeFunction[]>(key: T): T;
export { Function_2 as Function }
export declare function Japanese<T extends KeyTypeJapanese | KeyTypeJapanese[]>(key: T): T;
export declare interface KBEvent extends KeyboardEvent {
readonly type: KBEventName;
readonly key: KeyType_2;
}
export declare type KBEventName = 'keydown' | 'keypress' | 'keyup';
export declare type KBHandler = (ev: KeyboardEvent) => void;
export declare interface KBSetting extends RawKBSetting {
target: GlobalEventHandlers;
event: KBEventName;
capture: boolean;
}
export declare type KBSettings = KBSetting[];
export declare const Key: Key;
export declare interface Key {
<T extends KeyType_2 | KeyType_2[]>(key: T): T;
/**
* ## See Also
* - {@link https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values#special_values}
*/
type KeyTypeSpecial = 'Unidentified';
declare function Special<T extends KeyTypeSpecial | KeyTypeSpecial[]>(key: T): T;
type KeyTypeModifier = 'Alt' | 'AltGraph' | 'CapsLock' | 'Control' | 'Fn' | 'FnLock' | 'Hyper' | 'Meta' | 'NumLock' | 'ScrollLock' | 'Shift' | 'Super' | 'Symbol' | 'SymbolLock';
declare function Modifier<T extends KeyTypeModifier | KeyTypeModifier[]>(key: T): T;
type KeyTypeWhitespace = 'Enter' | 'Tab' | ' ';
declare function Whitespace<T extends KeyTypeWhitespace | KeyTypeWhitespace[]>(key: T): T;
type KeyTypeNavigation = 'ArrowDown' | 'ArrowLeft' | 'ArrowRight' | 'ArrowUp' | 'End' | 'Home' | 'PageDown' | 'PageUp';
declare function Navigation<T extends KeyTypeNavigation | KeyTypeNavigation[]>(key: T): T;
type KeyTypeEditing = 'Backspace' | 'Clear' | 'Copy' | 'CrSel' | 'Cut' | 'Delete' | 'EraseEof' | 'ExSel' | 'Insert' | 'Paste' | 'Redo' | 'Undo';
declare function Editing<T extends KeyTypeEditing | KeyTypeEditing[]>(key: T): T;
type KeyTypeUI = 'Accept' | 'Again' | 'Attn' | 'Cancel' | 'ContextMenu' | 'Escape' | 'Execute' | 'Find' | 'Finish' | 'Help' | 'Pause' | 'Play' | 'Props' | 'Select' | 'ZoomIn' | 'ZoomOut';
declare function UI<T extends KeyTypeUI | KeyTypeUI[]>(key: T): T;
type KeyTypeCommonIME = 'AllCandidates' | 'Alphanumeric' | 'CodeInput' | 'Compose' | 'Convert' | 'Dead' | 'FinalMode' | 'GroupFirst' | 'GroupLast' | 'GroupNext' | 'GroupPrevious' | 'ModeChange' | 'NextCandidate' | 'NonConvert' | 'PreviousCandidate' | 'Process' | 'SingleCandidate';
declare function CommonIME<T extends KeyTypeCommonIME | KeyTypeCommonIME[]>(key: T): T;
type KeyTypeKorean = 'HangulMode' | 'HanjaMode' | 'JunjaMode';
declare function Korean<T extends KeyTypeKorean | KeyTypeKorean[]>(key: T): T;
type KeyTypeJapanese = 'Eisu' | 'Hankaku' | 'Hiragana' | 'HiraganaKatakana' | 'KanaMode' | 'KanjiMode' | 'Katakana' | 'Romaji' | 'Zenkaku' | 'ZenkakuHanaku';
declare function Japanese<T extends KeyTypeJapanese | KeyTypeJapanese[]>(key: T): T;
type KeyTypeFunction = 'F1' | 'F2' | 'F3' | 'F4' | 'F5' | 'F6' | 'F7' | 'F8' | 'F9' | 'F10' | 'F11' | 'F12' | 'F13' | 'F14' | 'F15' | 'F16' | 'F17' | 'F18' | 'F19' | 'F20' | 'Soft1' | 'Soft2' | 'Soft3' | 'Soft4';
declare function Function<T extends KeyTypeFunction | KeyTypeFunction[]>(key: T): T;
type KeyType = KeyTypeModifier | KeyTypeWhitespace | KeyTypeNavigation | KeyTypeEditing | KeyTypeUI | KeyTypeCommonIME | KeyTypeKorean | KeyTypeJapanese | KeyTypeFunction;
declare const Key: Key;
interface Key {
<T extends KeyType | KeyType[]>(key: T): T;
Special: typeof Special;

@@ -48,51 +38,21 @@ Modifier: typeof Modifier;

Japanese: typeof Japanese;
Function: typeof Function_2;
is<T extends KeyType_2 | KeyType_2[] | Readonly<KeyType_2[]>>(source: any, key: T): source is KeyType_2;
Function: typeof Function;
is<T extends KeyType | KeyType[] | Readonly<KeyType[]>>(source: any, key: T): source is KeyType;
}
export declare class KeyboardService {
readonly settings: ComputedKBSetting[];
private _running;
get running(): boolean;
constructor(settings: RawKBSettings);
run(): void;
stop(): void;
type KBEventName = 'keydown' | 'keypress' | 'keyup';
interface KBEvent extends KeyboardEvent {
readonly type: KBEventName;
readonly key: KeyType;
}
declare type KeyType_2 = KeyTypeModifier | KeyTypeWhitespace | KeyTypeNavigation | KeyTypeEditing | KeyTypeUI | KeyTypeCommonIME | KeyTypeKorean | KeyTypeJapanese | KeyTypeFunction;
export { KeyType_2 as KeyType }
export declare type KeyTypeCommonIME = 'AllCandidates' | 'Alphanumeric' | 'CodeInput' | 'Compose' | 'Convert' | 'Dead' | 'FinalMode' | 'GroupFirst' | 'GroupLast' | 'GroupNext' | 'GroupPrevious' | 'ModeChange' | 'NextCandidate' | 'NonConvert' | 'PreviousCandidate' | 'Process' | 'SingleCandidate';
export declare type KeyTypeEditing = 'Backspace' | 'Clear' | 'Copy' | 'CrSel' | 'Cut' | 'Delete' | 'EraseEof' | 'ExSel' | 'Insert' | 'Paste' | 'Redo' | 'Undo';
export declare type KeyTypeFunction = 'F1' | 'F2' | 'F3' | 'F4' | 'F5' | 'F6' | 'F7' | 'F8' | 'F9' | 'F10' | 'F11' | 'F12' | 'F13' | 'F14' | 'F15' | 'F16' | 'F17' | 'F18' | 'F19' | 'F20' | 'Soft1' | 'Soft2' | 'Soft3' | 'Soft4';
export declare type KeyTypeJapanese = 'Eisu' | 'Hankaku' | 'Hiragana' | 'HiraganaKatakana' | 'KanaMode' | 'KanjiMode' | 'Katakana' | 'Romaji' | 'Zenkaku' | 'ZenkakuHanaku';
export declare type KeyTypeKorean = 'HangulMode' | 'HanjaMode' | 'JunjaMode';
export declare type KeyTypeModifier = 'Alt' | 'AltGraph' | 'CapsLock' | 'Control' | 'Fn' | 'FnLock' | 'Hyper' | 'Meta' | 'NumLock' | 'ScrollLock' | 'Shift' | 'Super' | 'Symbol' | 'SymbolLock';
export declare type KeyTypeNavigation = 'ArrowDown' | 'ArrowLeft' | 'ArrowRight' | 'ArrowUp' | 'End' | 'Home' | 'PageDown' | 'PageUp';
/**
* ## See Also
* - {@link https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values#special_values}
*/
export declare type KeyTypeSpecial = 'Unidentified';
export declare type KeyTypeUI = 'Accept' | 'Again' | 'Attn' | 'Cancel' | 'ContextMenu' | 'Escape' | 'Execute' | 'Find' | 'Finish' | 'Help' | 'Pause' | 'Play' | 'Props' | 'Select' | 'ZoomIn' | 'ZoomOut';
export declare type KeyTypeWhitespace = 'Enter' | 'Tab' | ' ';
export declare function Korean<T extends KeyTypeKorean | KeyTypeKorean[]>(key: T): T;
export declare function Modifier<T extends KeyTypeModifier | KeyTypeModifier[]>(key: T): T;
export declare function Navigation<T extends KeyTypeNavigation | KeyTypeNavigation[]>(key: T): T;
export declare interface RawKBSetting {
type KBHandler = (ev: KeyboardEvent) => void;
interface KBSetting extends RawKBSetting {
target: GlobalEventHandlers;
event: KBEventName;
capture: boolean;
}
type RawKBSettings = RawKBSetting | RawKBSetting[];
interface RawKBSetting {
target?: GlobalEventHandlers;
key?: KeyType_2 | KeyType_2[] | Readonly<KeyType_2[]>;
key?: KeyType | KeyType[] | Readonly<KeyType[]>;
/**

@@ -105,11 +65,19 @@ * @default "keydown"

}
type KBSettings = KBSetting[];
interface ComputedKBSetting {
target: GlobalEventHandlers;
event: KBEventName;
capture: boolean;
settings: KBSettings;
handler: (ev: KeyboardEvent) => void;
}
declare class KeyboardService {
readonly settings: ComputedKBSetting[];
private _running;
get running(): boolean;
constructor(settings: RawKBSettings);
run(): void;
stop(): void;
}
export declare type RawKBSettings = RawKBSetting | RawKBSetting[];
export declare function Special<T extends KeyTypeSpecial | KeyTypeSpecial[]>(key: T): T;
export declare function UI<T extends KeyTypeUI | KeyTypeUI[]>(key: T): T;
export declare function Whitespace<T extends KeyTypeWhitespace | KeyTypeWhitespace[]>(key: T): T;
export { }
export { CommonIME, Editing, Function, Japanese, KBEvent, KBEventName, KBHandler, KBSetting, KBSettings, Key, KeyType, KeyTypeCommonIME, KeyTypeEditing, KeyTypeFunction, KeyTypeJapanese, KeyTypeKorean, KeyTypeModifier, KeyTypeNavigation, KeyTypeSpecial, KeyTypeUI, KeyTypeWhitespace, KeyboardService, Korean, Modifier, Navigation, RawKBSetting, RawKBSettings, Special, UI, Whitespace };
{
"name": "@fastkit/keyboard",
"version": "0.12.8",
"version": "0.12.9",
"description": "Observer implementation to handle keyboard input to Type safe.",
"keywords": [
"fastkit",
"keyboard"
],
"homepage": "https://github.com/dadajam4/fastkit/tree/main/packages/keyboard#readme",
"bugs": {
"url": "https://github.com/dadajam4/fastkit/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/dadajam4/fastkit.git"
},
"license": "MIT",
"author": "dadajam4",
"type": "module",
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dist/keyboard.d.ts",
"import": {
"default": "./dist/keyboard.mjs"
}
},
"./*": "./dist/*"
},
"main": "./dist/keyboard.mjs",
"types": "./dist/keyboard.d.ts",
"typesVersions": {
"*": {
".": [
"./dist/keyboard.d.ts"
]
}
},
"files": [
"dist"
],
"dependencies": {
"@fastkit/helpers": "0.12.9"
},
"_docs": {

@@ -13,26 +53,13 @@ "scope": "",

},
"main": "./dist/keyboard.mjs",
"exports": {
".": "./dist/keyboard.mjs",
"./dist/*": "./dist/*",
"./package.json": "./package.json"
},
"files": [
"dist"
],
"types": "dist/keyboard.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/dadajam4/fastkit.git"
},
"keywords": [
"fastkit",
"keyboard"
],
"author": "dadajam4",
"license": "MIT",
"bugs": {
"url": "https://github.com/dadajam4/fastkit/issues"
},
"homepage": "https://github.com/dadajam4/fastkit/tree/main/packages/keyboard#readme"
}
"scripts": {
"build": "plugboy build",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
"eslint": "eslint . --ext ts,tsx,js,vue,html,yaml",
"eslint:fix": "eslint . --ext ts,tsx,js,vue,html,yaml --fix",
"format": "pnpm run eslint:fix",
"lint": "pnpm run eslint",
"stub": "plugboy stub",
"test": "vitest run",
"typecheck": "tsc --noEmit"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc