Skip to content

Commit f6a6e0d

Browse files
committed
0.0.0
0 parents  commit f6a6e0d

27 files changed

Lines changed: 3283 additions & 0 deletions

.editorconfig

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
root = true
2+
3+
# =============================================================================
4+
# DEFAULTS
5+
# =============================================================================
6+
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
indent_size = 4
11+
indent_style = tab
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
14+
15+
# =============================================================================
16+
# DOCUMENTATION
17+
# =============================================================================
18+
19+
[*.md]
20+
trim_trailing_whitespace = false
21+
22+
# =============================================================================
23+
# CONFIGURATION
24+
# =============================================================================
25+
26+
[*.yaml]
27+
indent_size = 2
28+
indent_style = space

.gitattributes

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# =============================================================================
2+
# LINGUIST OVERRIDES
3+
# =============================================================================
4+
5+
# JSON with JavaScript-style code comments
6+
.vscode/*.json linguist-language=JSON-with-Comments
7+
tsconfig*.json linguist-language=JSON-with-Comments
8+
9+
# =============================================================================
10+
# MERGE STRATEGIES
11+
# =============================================================================
12+
13+
# Lock files (prevent invalid merges)
14+
package-lock.json merge=binary

.github/workflows/deploy.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build-and-deploy:
19+
environment:
20+
name: github-pages
21+
url: ${{ steps.deployment.outputs.page_url }}
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: 22
31+
cache: "npm"
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
36+
- name: Build Project
37+
run: npm run build
38+
39+
- name: Setup Pages
40+
uses: actions/configure-pages@v5
41+
42+
- name: Upload to Pages
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
path: "./dist"
46+
47+
- name: Deploy Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v4

.github/workflows/test.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 22
18+
cache: "npm"
19+
20+
- name: Install dependencies
21+
run: npm ci
22+
23+
- name: Install Playwright browsers
24+
run: npx playwright install --with-deps chromium firefox webkit
25+
26+
- name: Run tests
27+
id: tests
28+
run: |
29+
if npm test; then
30+
echo "status=passing" >> $GITHUB_OUTPUT
31+
echo "color=brightgreen" >> $GITHUB_OUTPUT
32+
else
33+
echo "status=failing" >> $GITHUB_OUTPUT
34+
echo "color=red" >> $GITHUB_OUTPUT
35+
exit 1
36+
fi
37+
38+
- name: Generate badges
39+
if: github.ref == 'refs/heads/main'
40+
run: |
41+
# Create orphan branch for badges
42+
git checkout --orphan badges || git checkout badges
43+
git rm -rf . 2>/dev/null || true
44+
45+
# Create both badges
46+
echo "{\"schemaVersion\": 1, \"label\": \"tests\", \"message\": \"${{ steps.tests.outputs.status }}\", \"color\": \"${{ steps.tests.outputs.color }}\"}" > tests.json
47+
48+
git config user.name github-actions
49+
git config user.email github-actions@github.com
50+
git add tests.json
51+
git commit -m "Update badges"
52+
git push origin badges --force

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# =============================================================================
2+
# DEPENDENCIES
3+
# =============================================================================
4+
5+
node_modules
6+
7+
# =============================================================================
8+
# BUILD OUTPUT
9+
# =============================================================================
10+
11+
dist
12+
*.tsbuildinfo
13+
14+
# =============================================================================
15+
# TEST COVERAGE
16+
# =============================================================================
17+
18+
coverage
19+
test/__screenshots__
20+
21+
# =============================================================================
22+
# LOCAL
23+
# =============================================================================
24+
25+
*.local
26+
27+
# =============================================================================
28+
# LOGS
29+
# =============================================================================
30+
31+
*.log
32+
33+
# =============================================================================
34+
# OS
35+
# =============================================================================
36+
37+
.DS_Store

.npmrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# =============================================================================
2+
# PACKAGE MANAGEMENT
3+
# =============================================================================
4+
5+
# Save exact versions instead of ranges
6+
save-exact=true
7+
8+
# Automatically install peer dependencies
9+
auto-install-peers=true
10+
11+
# Use package-lock.json for consistent installs
12+
package-lock=true

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["biomejs.biome", "dprint.dprint"]
3+
}

.vscode/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3+
// Editor
4+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5+
"editor.defaultFormatter": "dprint.dprint",
6+
"editor.detectIndentation": false,
7+
"editor.insertSpaces": false,
8+
"editor.tabSize": 4,
9+
"json.schemaDownload.enable": true,
10+
"js/ts.tsdk.path": "node_modules/typescript/lib"
11+
}

LICENSE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# MIT No Attribution
2+
3+
Copyright 2026 Jonathan Neal
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so.
11+
12+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18+
SOFTWARE.

README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# types-keyboardevent
2+
3+
**types-keyboardevent** provides TypeScript types for `KeyboardEvent`,
4+
generated directly from W3C UI Events KeyboardEvent specifications.
5+
6+
```bash
7+
npm install types-keyboardevent
8+
```
9+
10+
- `KeyboardEventCode` represents a union of known `event.code` values.
11+
- `KeyboardEventKey` represents a union of known `event.key` values.
12+
- Includes sub-types such as `KeyboardEventCode.Numpad` and `KeyboardEventKey.Navigation`.
13+
- Source is generated directly from:
14+
- https://w3c.github.io/uievents-code/
15+
- https://w3c.github.io/uievents-key/
16+
17+
This package is type-only at runtime.
18+
Its JavaScript entrypoints intentionally export no values.
19+
20+
## Usage
21+
22+
```ts
23+
import type { KeyboardEventCode, KeyboardEventKey } from "types-keyboardevent";
24+
25+
const isMovementCode = (code: KeyboardEventCode.Arrowpad) => code === "ArrowLeft" || code === "ArrowRight";
26+
27+
const isConfirmKey = (key: KeyboardEventKey) => key === "Enter" || key === " ";
28+
```
29+
30+
You can also import the type families directly from their subpaths:
31+
32+
```ts
33+
import type { KeyboardEventCode } from "types-keyboardevent/KeyboardEventCode";
34+
import type { KeyboardEventKey } from "types-keyboardevent/KeyboardEventKey";
35+
```
36+
37+
## API surface
38+
39+
### `KeyboardEventCode`
40+
41+
Includes values such as `"KeyA"`, `"ArrowRight"`, `"NumpadEnter"`, and media-related codes.
42+
43+
Useful namespaces include:
44+
45+
- `KeyboardEventCode.Modifier`
46+
- `KeyboardEventCode.Arrowpad`
47+
- `KeyboardEventCode.Numpad`
48+
- `KeyboardEventCode.Function`
49+
- `KeyboardEventCode.Media`
50+
51+
### `KeyboardEventKey`
52+
53+
Includes values such as `"Enter"`, `"ArrowRight"`, `"AudioVolumeUp"`, and `"MediaPlayPause"`.
54+
55+
Useful namespaces include:
56+
57+
- `KeyboardEventKey.Modifier`
58+
- `KeyboardEventKey.Navigation`
59+
- `KeyboardEventKey.Editing`
60+
- `KeyboardEventKey.Multimedia`
61+
- `KeyboardEventKey.Audio`
62+
- `KeyboardEventKey.Browser`
63+
64+
## License
65+
66+
[MIT-0](./LICENSE.md)

0 commit comments

Comments
 (0)