Skip to content

Commit

Permalink
fix typescript export for init args func (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanosdev authored Feb 21, 2024
1 parent 0219c2d commit 4b68f47
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion rust/candid_parser/src/bindings/typescript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ import type { IDL } from '@dfinity/candid';
.append(RcDoc::line())
.append("export declare const idlFactory: IDL.InterfaceFactory;")
.append(RcDoc::line())
.append("export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];"),
.append("export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];"),
};
let doc = RcDoc::text(header)
.append(RcDoc::line())
Expand Down
2 changes: 1 addition & 1 deletion rust/candid_parser/tests/assets/ok/actor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ export interface _SERVICE {
'o' : ActorMethod<[o], o>,
}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
2 changes: 1 addition & 1 deletion rust/candid_parser/tests/assets/ok/class.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export interface _SERVICE {
'set' : ActorMethod<[List], List>,
}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
2 changes: 1 addition & 1 deletion rust/candid_parser/tests/assets/ok/cyclic.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export type Y = Z;
export type Z = A;
export interface _SERVICE { 'f' : ActorMethod<[A, B, C, X, Y, Z], undefined> }
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
2 changes: 1 addition & 1 deletion rust/candid_parser/tests/assets/ok/empty.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ export interface _SERVICE {
'h' : ActorMethod<[[T, never]], { 'a' : T } | { 'b' : {} }>,
}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
2 changes: 1 addition & 1 deletion rust/candid_parser/tests/assets/ok/escape.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export interface t {
}
export interface _SERVICE { '\n\'\"\'\'\"\"\r\t' : ActorMethod<[t], undefined> }
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
2 changes: 1 addition & 1 deletion rust/candid_parser/tests/assets/ok/example.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ export interface _SERVICE {
'x' : ActorMethod<[a, b], [[] | [a], [] | [b]]>,
}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
2 changes: 1 addition & 1 deletion rust/candid_parser/tests/assets/ok/fieldnat.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export interface _SERVICE {
'foo' : ActorMethod<[{ _2_ : bigint }], { _2_ : bigint, '_2' : bigint }>,
}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
2 changes: 1 addition & 1 deletion rust/candid_parser/tests/assets/ok/keyword.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ export interface _SERVICE {
>,
}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
2 changes: 1 addition & 1 deletion rust/candid_parser/tests/assets/ok/management.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@ export interface _SERVICE {
>,
}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
2 changes: 1 addition & 1 deletion rust/candid_parser/tests/assets/ok/recursion.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ export type tree = {
{ 'leaf' : bigint };
export interface _SERVICE extends s {}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
2 changes: 1 addition & 1 deletion rust/candid_parser/tests/assets/ok/recursive_class.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ import type { IDL } from '@dfinity/candid';
export interface s { 'next' : ActorMethod<[], Principal> }
export interface _SERVICE extends s {}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
2 changes: 1 addition & 1 deletion rust/candid_parser/tests/assets/ok/service.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export interface _SERVICE {
>,
}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
2 changes: 1 addition & 1 deletion rust/candid_parser/tests/assets/ok/unicode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export interface _SERVICE {
'👀' : ActorMethod<[bigint], bigint>,
}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];

0 comments on commit 4b68f47

Please sign in to comment.