@stacksjs/types 0.58.62 → 0.58.64

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/types",
3
3
  "type": "module",
4
- "version": "0.58.62",
4
+ "version": "0.58.64",
5
5
  "description": "The Stacks framework types.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
package/src/cli.ts CHANGED
@@ -29,7 +29,7 @@ export type Writable =
29
29
 
30
30
  export type In = Readable
31
31
  export type Out = Writable
32
- export type Err = Writable
32
+ // export type Err = Writable // TODO: find a workaround for this to not clash with our other Err export
33
33
 
34
34
  /**
35
35
  * The file descriptor for the standard input. It may be:
package/src/cron-jobs.ts CHANGED
@@ -29,11 +29,6 @@ export type Jobs = Job[]
29
29
  export type CronJob = Job
30
30
  export type CronJobs = Jobs
31
31
 
32
- // export type Job = JobOptions
33
- // export type Jobs = Job[]
34
- // export type CronJob = Job
35
- // export type CronJobs = Jobs
36
-
37
32
  export enum Every {
38
33
  // Second = '* * * * * *',
39
34
  // FiveSeconds = '*/5 * * * * *',
package/src/errors.ts CHANGED
@@ -7,5 +7,5 @@
7
7
  // toString(): string
8
8
  // }
9
9
 
10
- export type StacksError = Error
10
+ // export type StacksError = Error
11
11
  export type CommandError = Error
package/src/router.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { Action } from '@stacksjs/actions'
2
+
1
3
  export interface NitroEventHandler {
2
4
  /**
3
5
  * Path prefix or route
@@ -41,7 +43,7 @@ export interface Route {
41
43
  url: string // used synonymously with uri
42
44
  method: HttpMethod
43
45
  pattern: RegExp
44
- callback: RouteCallback | ActionName
46
+ callback: RouteCallback | ActionName | Action
45
47
  paramNames: string[]
46
48
  middleware?: string | string[]
47
49
  statusCode?: StatusCode
@@ -57,12 +59,12 @@ export interface MiddlewareType {
57
59
  export type StatusCode = 200 | 201 | 202 | 204 | 301 | 302 | 304 | 400 | 401 | 403 | 404 | 500
58
60
  export type RedirectCode = Extract<StatusCode, 301 | 302>
59
61
 
60
- export type Middleware = () => void
62
+ export type MiddlewareFn = () => void
61
63
 
62
64
  export interface Middlewares {
63
- logger: Middleware
64
- auth: Middleware
65
- [key: string]: Middleware
65
+ logger: MiddlewareFn
66
+ auth: MiddlewareFn
67
+ [key: string]: MiddlewareFn
66
68
  }
67
69
 
68
70
  export interface RouteGroupOptions {