Skip to content

Commit c474d2a

Browse files
committed
make ScriptSuccess, ScriptFailure, and ScriptResponse global
1 parent ae3052c commit c474d2a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

env.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
type Replace<A, B> = Omit<A, keyof B> & B
2-
type ScriptSuccess<T = unknown> = { ok: true } & T
3-
type ScriptFailure = { ok: false, msg?: string }
4-
type ScriptResponse<T = unknown> = ScriptSuccess<T> | ScriptFailure
1+
type Replace<A, B> = Omit<A, keyof B> & BigInt
52
type ErrorScripts = Record<string, () => ScriptFailure>
63

74
type Subscripts = Record<string, Record<string, (...args: any) => any>> & {
@@ -891,6 +888,9 @@ type MongoProject<TDocument, TProjection> =
891888
type DeepFreeze<T> = { readonly [P in keyof T]: DeepFreeze<T[P]> }
892889

893890
declare global {
891+
type ScriptSuccess<T = unknown> = { ok: true } & T
892+
type ScriptFailure = { ok: false, msg?: string }
893+
type ScriptResponse<T = unknown> = ScriptSuccess<T> | ScriptFailure
894894
type Scriptor<TArgs extends any[] = any[]> = { name: string, call: (...args: TArgs) => unknown }
895895
type Context = CliContext | SubscriptContext | ScriptorContext | BrainContext
896896
type ObjectId = { $oid: string }

0 commit comments

Comments
 (0)