Skip to content

Commit

Permalink
Updated serializr.d.ts (#88)
Browse files Browse the repository at this point in the history
Added Context information to the typescript definitions
  • Loading branch information
smdesmet authored and alexggordon committed Aug 31, 2018
1 parent 0c3b115 commit c85a637
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion serializr.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export interface Context {
target: any;
parentContext: Context;
args: any;
await(modelschema: ClazzOrModelSchema<any>,id:string,callback?: (err: any, result: any) => void):any;
rootContext:Context;
}

export type Factory<T> = (context: Context) => T
Expand Down Expand Up @@ -57,7 +59,7 @@ export function alias(jsonName: string, propSchema?: PropSchema | boolean): Prop
export function child(modelschema: ClazzOrModelSchema<any>): PropSchema;
export function object(modelschema: ClazzOrModelSchema<any>): PropSchema;

export type RefLookupFunction = (id: string, callback: (err: any, result: any) => void) => void;
export type RefLookupFunction = (id: string, callback: (err: any, result: any) => void,context:Context) => void;
export type RegisterFunction = (id: any, object: any, context: Context) => void;

export function ref(modelschema: ClazzOrModelSchema<any>, lookupFn?: RefLookupFunction): PropSchema;
Expand Down

0 comments on commit c85a637

Please sign in to comment.