Skip to content

Commit bc41e6c

Browse files
committed
chore: wip
1 parent c837eed commit bc41e6c

File tree

8 files changed

+52
-56
lines changed

8 files changed

+52
-56
lines changed

storage/framework/core/database/src/kysely-bun-worker/mitt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Emitter, EventHandlerMap, EventType, Handler } from 'mitt'
22
import mitt from 'mitt'
33

44
export interface EmitterOnce<Events extends Record<EventType, unknown>> extends Emitter<Events> {
5-
once<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void
5+
once: <Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>) => void
66
}
77

88
export default function mittOnce<Events extends Record<EventType, unknown>>(

storage/framework/core/events/src/index.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,11 @@ export type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<
2323
export interface Emitter<Events extends Record<EventType, unknown>> {
2424
all: EventHandlerMap<Events>
2525

26-
on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void
27-
on(type: '*', handler: WildcardHandler<Events>): void
26+
on: (<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>) => void) & ((type: '*', handler: WildcardHandler<Events>) => void)
2827

29-
off<Key extends keyof Events>(type: Key, handler?: Handler<Events[Key]>): void
30-
off(type: '*', handler: WildcardHandler<Events>): void
28+
off: (<Key extends keyof Events>(type: Key, handler?: Handler<Events[Key]>) => void) & ((type: '*', handler: WildcardHandler<Events>) => void)
3129

32-
emit<Key extends keyof Events>(type: Key, event: Events[Key]): void
33-
emit<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): void
30+
emit: (<Key extends keyof Events>(type: Key, event: Events[Key]) => void) & (<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never) => void)
3431
}
3532

3633
/**

storage/framework/core/router/src/router.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ import type { RedirectCode, Route, RouteGroupOptions, StatusCode } from '@stacks
22
import { projectPath } from '@stacksjs/path'
33

44
export interface RouterInterface {
5-
get(url: Route['url'], callback: Route['callback']): this
6-
post(url: Route['url'], callback: Route['callback']): this
7-
view(url: Route['url'], callback: Route['callback']): this
8-
redirect(url: Route['url'], callback: Route['callback'], status?: RedirectCode): this
9-
delete(url: Route['url'], callback: Route['callback']): this
10-
patch(url: Route['url'], callback: Route['callback']): this
11-
put(url: Route['url'], callback: Route['callback']): this
12-
group(options: RouteGroupOptions, callback: () => void): this
13-
name(name: string): this
14-
middleware(middleware: Route['middleware']): this
15-
getRoutes(): Promise<Route[]>
5+
get: (url: Route['url'], callback: Route['callback']) => this
6+
post: (url: Route['url'], callback: Route['callback']) => this
7+
view: (url: Route['url'], callback: Route['callback']) => this
8+
redirect: (url: Route['url'], callback: Route['callback'], status?: RedirectCode) => this
9+
delete: (url: Route['url'], callback: Route['callback']) => this
10+
patch: (url: Route['url'], callback: Route['callback']) => this
11+
put: (url: Route['url'], callback: Route['callback']) => this
12+
group: (options: RouteGroupOptions, callback: () => void) => this
13+
name: (name: string) => this
14+
middleware: (middleware: Route['middleware']) => this
15+
getRoutes: () => Promise<Route[]>
1616
}
1717

1818
export class Router implements RouterInterface {

storage/framework/core/scheduler/src/index.ts

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,36 @@ import { CronJob as cron } from 'cron'
55
// }
66

77
export interface Schedule {
8-
action(action: string): this
9-
command(cmd: string): this
10-
job(job: string): this
11-
exec(cmd: string): this
12-
call(callback: () => void): this
13-
everyMinute(): this
14-
everySecond(): this
15-
everyFiveMinutes(): this
16-
everyTenMinutes(): this
17-
everyThirtyMinutes(): this
18-
hourly(): this
19-
daily(): this
20-
twiceDaily(hour1: number, hour2: number): this
21-
weekly(): this
22-
monthly(): this
23-
quarterly(): this
24-
yearly(): this
25-
weekdays(): this
26-
weekends(): this
27-
mondays(): this
28-
tuesdays(): this
29-
wednesdays(): this
30-
thursdays(): this
31-
fridays(): this
32-
saturdays(): this
33-
sundays(): this
34-
between(startTime: string, endTime: string): this
35-
timezone(timezone: string): this
36-
when(callback: () => boolean): this
37-
at(time: string): this
8+
action: (action: string) => this
9+
command: (cmd: string) => this
10+
job: (job: string) => this
11+
exec: (cmd: string) => this
12+
call: (callback: () => void) => this
13+
everyMinute: () => this
14+
everySecond: () => this
15+
everyFiveMinutes: () => this
16+
everyTenMinutes: () => this
17+
everyThirtyMinutes: () => this
18+
hourly: () => this
19+
daily: () => this
20+
twiceDaily: (hour1: number, hour2: number) => this
21+
weekly: () => this
22+
monthly: () => this
23+
quarterly: () => this
24+
yearly: () => this
25+
weekdays: () => this
26+
weekends: () => this
27+
mondays: () => this
28+
tuesdays: () => this
29+
wednesdays: () => this
30+
thursdays: () => this
31+
fridays: () => this
32+
saturdays: () => this
33+
sundays: () => this
34+
between: (startTime: string, endTime: string) => this
35+
timezone: (timezone: string) => this
36+
when: (callback: () => boolean) => this
37+
at: (time: string) => this
3838
}
3939

4040
export class ScheduleImpl implements Schedule {

storage/framework/core/utils/src/promise.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export interface SingletonPromiseReturn<T> {
1515
* Promise with `resolve` and `reject` methods of itself
1616
*/
1717
export interface ControlledPromise<T = void> extends Promise<T> {
18-
resolve(value: T | PromiseLike<T>): void
19-
reject(reason?: any): void
18+
resolve: (value: T | PromiseLike<T>) => void
19+
reject: (reason?: any) => void
2020
}
2121

2222
/**

storage/framework/core/validation/src/rules.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface FieldContext {
2828
/**
2929
* Mutate the value of field under validation.
3030
*/
31-
mutate(newValue: any, field: FieldContext): void
31+
mutate: (newValue: any, field: FieldContext) => void
3232

3333
/**
3434
* Report error to the error reporter
@@ -87,12 +87,12 @@ export interface ErrorReporterContract {
8787
/**
8888
* Creates an instance of an exception to throw
8989
*/
90-
createError(): Error
90+
createError: () => Error
9191

9292
/**
9393
* Report error for a field
9494
*/
95-
report(message: string, rule: string, field: FieldContext, args?: Record<string, any>): any
95+
report: (message: string, rule: string, field: FieldContext, args?: Record<string, any>) => any
9696
}
9797

9898
export const isMoney = validator.createRule((value: unknown, _, field: FieldContext) => {

storage/framework/server/build.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { $ } from 'bun'
21
import { frameworkPath, projectPath } from '@stacksjs/path'
32
import { hasFiles } from '@stacksjs/storage'
43
import { log, runCommand } from '@stacksjs/cli'

storage/framework/types/stacks.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { MoneyValidator } from '@stacksjs/validation'
77
*/
88
declare module '@stacksjs/validation' {
99
interface Validator {
10-
money(): MoneyValidator
10+
money: () => MoneyValidator
1111
}
1212
}
1313

@@ -28,7 +28,7 @@ declare module '@stacksjs/strings' {
2828
*/
2929
declare module '@stacksjs/validation' {
3030
interface Validator {
31-
money(): MoneyValidator
31+
money: () => MoneyValidator
3232
}
3333
}
3434

0 commit comments

Comments
 (0)