@small-web/kitten-types 1.0.2 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/fragments.d.ts +14 -0
- package/global.d.ts +8 -1
- package/index.d.ts +2 -1
- package/package.json +11 -1
- package/types.d.ts +1 -1
- package/.idea/kitten-types.iml +0 -8
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -7
- package/CHANGELOG.md +0 -30
package/README.md
CHANGED
|
@@ -4,8 +4,6 @@ Type-safety for [Kitten](https://kitten.small-web.org) apps and sites.
|
|
|
4
4
|
|
|
5
5
|
This is a **types-only** package. It declares the global `kitten` namespace (via `declare global`) and exports reusable Kitten types you can use to annotate your own code.
|
|
6
6
|
|
|
7
|
-
> 💡 The older [`@small-web/kitten`](https://www.npmjs.com/package/@small-web/kitten) module [has now been deprecated](#relationship-to-small-web-kitten). You should use this module for new projects and plan on migrating existing projects over to it going forward.
|
|
8
|
-
|
|
9
7
|
## Install
|
|
10
8
|
|
|
11
9
|
```shell
|
|
@@ -116,7 +114,9 @@ If you want type safety for your custom project database, please create and use
|
|
|
116
114
|
|
|
117
115
|
## Relationship to `@small-web/kitten`
|
|
118
116
|
|
|
119
|
-
The older [`@small-web/kitten`](https://www.npmjs.com/package/@small-web/kitten)
|
|
117
|
+
> 💡 The older [`@small-web/kitten`](https://www.npmjs.com/package/@small-web/kitten) module [has now been deprecated](#relationship-to-small-web-kitten). You should use this module for new projects and plan on migrating existing projects over to it going forward.
|
|
118
|
+
|
|
119
|
+
The older globals module cast the members of `globalThis.kitten` at runtime and provided type safety for JavaScript projects (prior to TypeScript support being added to Kitten).
|
|
120
120
|
|
|
121
121
|
This was problematic as a discrepency between Kitten and the globals module was not just a missing completion in your editor but could break your app at runtime.
|
|
122
122
|
|
package/fragments.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type Fragment = (props?: {SLOT?: any}) => string
|
|
2
|
+
|
|
3
|
+
declare module '*.fragment.html' {
|
|
4
|
+
const fragment: Fragment
|
|
5
|
+
export default fragment
|
|
6
|
+
}
|
|
7
|
+
declare module '*.fragment.css' {
|
|
8
|
+
const fragment: Fragment
|
|
9
|
+
export default fragment
|
|
10
|
+
}
|
|
11
|
+
declare module '*.fragment.md' {
|
|
12
|
+
const fragment: Fragment
|
|
13
|
+
export default fragment
|
|
14
|
+
}
|
package/global.d.ts
CHANGED
|
@@ -211,12 +211,19 @@ export interface kitten {
|
|
|
211
211
|
@remarks For internal use only.
|
|
212
212
|
*/
|
|
213
213
|
appRepository?: {
|
|
214
|
+
latestCompatibleVersion: string,
|
|
215
|
+
latestVersion: string,
|
|
216
|
+
latestApiVersion: string,
|
|
217
|
+
manualUpdateAvailable: boolean,
|
|
218
|
+
originRemoteUrl: string,
|
|
219
|
+
currentVersion: string,
|
|
220
|
+
latestAvailableCommit: string,
|
|
214
221
|
upgradeAppToLatestCompatibleVersion(): Promise<void>
|
|
215
222
|
upgradeAppToLatestAvailableCommit(): Promise<void>
|
|
216
223
|
updateAppToVersion(versionTag: string): Promise<void>
|
|
217
224
|
update(): Promise<void>
|
|
218
225
|
hasCompatibleAppVersion: boolean
|
|
219
|
-
|
|
226
|
+
canBeUpgraded: boolean
|
|
220
227
|
hasNewerApiVersion: boolean
|
|
221
228
|
upgradeOrDowngrade(versionTag: string, lowercase: boolean): 'upgrade' | 'downgrade'
|
|
222
229
|
isEqualToVersion(versionTag: string): boolean
|
package/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import './global.d.ts'
|
|
10
|
+
import './fragments.d.ts'
|
|
10
11
|
|
|
11
12
|
// Reusable types, re-exported for explicit annotations
|
|
12
13
|
// (e.g. `import type { KittenRequest } from '@small-web/kitten-types'`).
|
|
@@ -33,7 +34,7 @@ export type {
|
|
|
33
34
|
Signature
|
|
34
35
|
} from './types.d.ts'
|
|
35
36
|
|
|
36
|
-
export { yaml } from './types.d.ts'
|
|
37
|
+
export type { yaml } from './types.d.ts'
|
|
37
38
|
|
|
38
39
|
// Also export hand-written global namespace shape, in case an author wants to reference it explicitly (e.g. `typeof kitten`).
|
|
39
40
|
export type { kitten } from './global.d.ts'
|
package/package.json
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@small-web/kitten-types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Types-only package for Kitten: declares global `kitten` namespace and exports Kitten types.",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"index.d.ts",
|
|
8
|
+
"global.d.ts",
|
|
9
|
+
"fragments.d.ts",
|
|
10
|
+
"types.d.ts",
|
|
11
|
+
"polka/index.d.ts",
|
|
12
|
+
"slugify/index.d.ts",
|
|
13
|
+
"ws/index.d.ts"
|
|
14
|
+
],
|
|
6
15
|
"exports": {
|
|
7
16
|
".": {
|
|
8
17
|
"types": "./index.d.ts"
|
|
9
18
|
},
|
|
10
19
|
"./global.d.ts": "./global.d.ts",
|
|
20
|
+
"./fragments.d.ts": "./fragments.d.ts",
|
|
11
21
|
"./types.d.ts": "./types.d.ts"
|
|
12
22
|
},
|
|
13
23
|
"type": "module",
|
package/types.d.ts
CHANGED
|
@@ -448,7 +448,7 @@ export class KittenPage extends KittenComponent {
|
|
|
448
448
|
|
|
449
449
|
@deprecated Instead of `on(eventName, handler)`, export `onEventName()` from your page (or add `onEventName()` method to your `kitten.Page` subclass if using class-based page routes.)
|
|
450
450
|
*/
|
|
451
|
-
on (eventName: string, eventHandler: () => void):void
|
|
451
|
+
on (eventName: string, eventHandler: (data: any) => void):void
|
|
452
452
|
|
|
453
453
|
/**
|
|
454
454
|
Send specified message to just this page’s socket.
|
package/.idea/kitten-types.iml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="WEB_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager">
|
|
4
|
-
<content url="file://$MODULE_DIR$" />
|
|
5
|
-
<orderEntry type="inheritedJdk" />
|
|
6
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
|
-
</component>
|
|
8
|
-
</module>
|
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/kitten-types.iml" filepath="$PROJECT_DIR$/.idea/kitten-types.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
package/.idea/vcs.xml
DELETED
package/CHANGELOG.md
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
-
|
|
7
|
-
## [1.0.2] - 2026-06-26
|
|
8
|
-
|
|
9
|
-
### Improved
|
|
10
|
-
|
|
11
|
-
- Documentation
|
|
12
|
-
|
|
13
|
-
### Fixed
|
|
14
|
-
|
|
15
|
-
- Polka router export (as referenced at `kitten.app.router`).
|
|
16
|
-
|
|
17
|
-
## [1.0.1] - 2026-06-26
|
|
18
|
-
|
|
19
|
-
### Added
|
|
20
|
-
|
|
21
|
-
- Missing types
|
|
22
|
-
- Documentation for all types
|
|
23
|
-
|
|
24
|
-
## [1.0.0] - 2026-06-23
|
|
25
|
-
|
|
26
|
-
__Initial release__
|
|
27
|
-
|
|
28
|
-
The predecessor of this module is Kitten Globals ([@small-web/kitten](https://codeberg.org/kitten/globals)), which has now been deprecated.
|
|
29
|
-
|
|
30
|
-
For previous history, please see that module.
|