@small-web/kitten-types 1.1.5 → 2.0.0

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.
Files changed (80) hide show
  1. package/README.md +9 -2
  2. package/fragments.d.ts +13 -14
  3. package/global.d.ts +6 -1096
  4. package/index.d.ts +7 -27
  5. package/kitten/src/AppDatabase.d.ts +10 -0
  6. package/kitten/src/AppRepository.d.ts +101 -0
  7. package/kitten/src/AutomaticUpdates.d.ts +21 -0
  8. package/kitten/src/Files.d.ts +61 -0
  9. package/kitten/src/GlobalInternalDatabase.d.ts +22 -0
  10. package/kitten/src/InternalDatabase.d.ts +7 -0
  11. package/kitten/src/REPL.d.ts +5 -0
  12. package/kitten/src/Routes.d.ts +41 -0
  13. package/kitten/src/Server.d.ts +76 -0
  14. package/kitten/src/ServerError.d.ts +6 -0
  15. package/kitten/src/Sessions.d.ts +32 -0
  16. package/kitten/src/Uploads.d.ts +20 -0
  17. package/kitten/src/Utils.d.ts +79 -0
  18. package/kitten/src/cli/commands/db.d.ts +48 -0
  19. package/kitten/src/cli/commands/deploy.d.ts +16 -0
  20. package/kitten/src/cli/commands/disable.d.ts +9 -0
  21. package/kitten/src/cli/commands/enable.d.ts +9 -0
  22. package/kitten/src/cli/commands/logs.d.ts +15 -0
  23. package/kitten/src/cli/commands/restart.d.ts +11 -0
  24. package/kitten/src/cli/commands/run.d.ts +15 -0
  25. package/kitten/src/cli/commands/serve.d.ts +13 -0
  26. package/kitten/src/cli/commands/shell.d.ts +1 -0
  27. package/kitten/src/cli/commands/start.d.ts +9 -0
  28. package/kitten/src/cli/commands/status.d.ts +15 -0
  29. package/kitten/src/cli/commands/stop.d.ts +9 -0
  30. package/kitten/src/cli/commands/uninstall.d.ts +9 -0
  31. package/kitten/src/cli/commands/update.d.ts +7 -0
  32. package/kitten/src/cli/index.d.ts +55 -0
  33. package/kitten/src/cli/lib/WarningBox.d.ts +8 -0
  34. package/kitten/src/cli/lib/header.d.ts +10 -0
  35. package/kitten/src/components/SvgSpinner.component.d.ts +9 -0
  36. package/kitten/src/lib/KittenComponent.d.ts +340 -0
  37. package/kitten/src/lib/KittenMoji.d.ts +35 -0
  38. package/kitten/src/lib/KittenPackage.d.ts +56 -0
  39. package/kitten/src/lib/KittenPage.d.ts +202 -0
  40. package/kitten/src/lib/Version.d.ts +49 -0
  41. package/kitten/src/lib/ansi-highlight-html.d.ts +5 -0
  42. package/kitten/src/lib/components/stateful/CopyButton.component.d.ts +14 -0
  43. package/kitten/src/lib/components/stateless/copyButton.component.d.ts +21 -0
  44. package/kitten/src/lib/crypto.d.ts +95 -0
  45. package/kitten/src/lib/deploy.d.ts +20 -0
  46. package/kitten/src/lib/ensure.d.ts +28 -0
  47. package/kitten/src/lib/fragments.d.ts +1 -0
  48. package/kitten/src/lib/globals.d.ts +10 -0
  49. package/kitten/src/lib/html.d.ts +61 -0
  50. package/kitten/src/lib/markdown.d.ts +16 -0
  51. package/kitten/src/lib/paths.d.ts +25 -0
  52. package/kitten/src/lib/service-status.d.ts +14 -0
  53. package/kitten/src/lib/system-exit-codes.d.ts +39 -0
  54. package/kitten/src/lib/terminal-link.d.ts +24 -0
  55. package/kitten/src/middleware/authentication.d.ts +8 -0
  56. package/kitten/src/middleware/index.d.ts +5 -0
  57. package/kitten/src/middleware/request-and-response-helpers.d.ts +6 -0
  58. package/kitten/src/middleware/request-log.d.ts +10 -0
  59. package/kitten/src/middleware/sessions.d.ts +3 -0
  60. package/kitten/src/middleware/stats.d.ts +8 -0
  61. package/kitten/src/middleware/trailing-slashes.d.ts +11 -0
  62. package/kitten/src/middleware/websocket.d.ts +14 -0
  63. package/kitten/src/routes/HttpRoute.d.ts +16 -0
  64. package/kitten/src/routes/LazilyLoadedRoute.d.ts +15 -0
  65. package/kitten/src/routes/PageRoute.d.ts +54 -0
  66. package/kitten/src/routes/PageSocketRoute.d.ts +42 -0
  67. package/kitten/src/routes/PostRoute.d.ts +64 -0
  68. package/kitten/src/routes/StaticRoute.d.ts +17 -0
  69. package/kitten/src/routes/WebSocketRoute.d.ts +21 -0
  70. package/kitten/src/routes/lib/validator.d.ts +18 -0
  71. package/kitten/src/types/fragments.d.ts +14 -0
  72. package/kitten/src/types/globals.d.ts +1239 -0
  73. package/kitten/src/types/index.d.ts +12 -0
  74. package/kitten/src/types/types.d.ts +476 -0
  75. package/kitten/third-party-libraries-with-missing-type-information/index.d.ts +37 -0
  76. package/package.json +16 -5
  77. package/types.d.ts +5 -712
  78. package/polka/index.d.ts +0 -111
  79. package/slugify/index.d.ts +0 -246
  80. /package/{ws → kitten/third-party-libraries-with-missing-type-information/ws}/index.d.ts +0 -0
package/README.md CHANGED
@@ -4,6 +4,8 @@ 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 types are automatically generated from the [Kitten source code](https://codeberg.org/kitten/app).
8
+
7
9
  ## Install
8
10
 
9
11
  ```shell
@@ -33,7 +35,8 @@ How you add language intelligence and static type checking for Kitten to your pr
33
35
  ### JavaScript
34
36
 
35
37
  1. [Install Kitten Types (@small-web/kitten-types)](#install) as a development-time dependency.
36
- 2. *Either* add `@ts-check` to the tops of your JavaScript files or add a jsconfig.json file to your project to enable type checking.
38
+
39
+ 2. *Either* add `@ts-check` to the tops of your JavaScript files or [add a jsconfig.json file](https://kitten.small-web.org/reference/#jsconfig-json) to your project to enable type checking.
37
40
 
38
41
  That’s it!
39
42
 
@@ -56,7 +59,11 @@ There’s one extra step (compared to JavaScript) when using TypeScript.
56
59
 
57
60
  1. [Install Kitten Types (@small-web/kitten-types)](#install) as a development-time dependency.
58
61
 
59
- 2. Create a tsconfig.json file.
62
+ ```shell
63
+ npm install --save-dev @small-web/kitten-types
64
+ ```
65
+
66
+ 2. [Create a tsconfig.json file.](https://kitten.small-web.org/reference/#tsconfig-json)
60
67
 
61
68
  3. Create a *globals.d.ts* file in your project:
62
69
 
package/fragments.d.ts CHANGED
@@ -1,14 +1,13 @@
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
- }
1
+ /**
2
+ Kitten Types (@small-web/kitten-types)
3
+
4
+ Ambient module declarations for Kitten fragment imports
5
+ (*.fragment.html, *.fragment.css, *.fragment.md).
6
+
7
+ Generated from Kitten’s TypeScript source code
8
+ (see kitten/ – regenerated via `npm run sync-types` in the Kitten repository).
9
+ */
10
+
11
+ import './kitten/src/types/fragments.d.ts'
12
+
13
+ export {}