Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing typescript export for init args #510

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion rust/candid_parser/src/bindings/typescript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ import type { IDL } from '@dfinity/candid';
None => RcDoc::nil(),
Some(actor) => pp_actor(env, actor)
.append(RcDoc::line())
.append("export declare const idlFactory: IDL.InterfaceFactory;"),
.append("export declare const idlFactory: IDL.InterfaceFactory;")
.append(RcDoc::line())
.append("export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];"),
};
let doc = RcDoc::text(header)
.append(RcDoc::line())
Expand Down
1 change: 1 addition & 0 deletions rust/candid_parser/tests/assets/ok/actor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ export interface _SERVICE {
'o' : ActorMethod<[o], o>,
}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
1 change: 1 addition & 0 deletions rust/candid_parser/tests/assets/ok/class.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ export interface _SERVICE {
'set' : ActorMethod<[List], List>,
}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
1 change: 1 addition & 0 deletions rust/candid_parser/tests/assets/ok/cyclic.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +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[];
1 change: 1 addition & 0 deletions rust/candid_parser/tests/assets/ok/empty.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +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[];
1 change: 1 addition & 0 deletions rust/candid_parser/tests/assets/ok/escape.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +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[];
1 change: 1 addition & 0 deletions rust/candid_parser/tests/assets/ok/example.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +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[];
1 change: 1 addition & 0 deletions rust/candid_parser/tests/assets/ok/fieldnat.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +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[];
1 change: 1 addition & 0 deletions rust/candid_parser/tests/assets/ok/keyword.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ export interface _SERVICE {
>,
}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
1 change: 1 addition & 0 deletions rust/candid_parser/tests/assets/ok/management.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,4 @@ export interface _SERVICE {
>,
}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
1 change: 1 addition & 0 deletions rust/candid_parser/tests/assets/ok/recursion.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +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[];
1 change: 1 addition & 0 deletions rust/candid_parser/tests/assets/ok/recursive_class.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +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[];
1 change: 1 addition & 0 deletions rust/candid_parser/tests/assets/ok/service.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ export interface _SERVICE {
>,
}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
1 change: 1 addition & 0 deletions rust/candid_parser/tests/assets/ok/unicode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ export interface _SERVICE {
'👀' : ActorMethod<[bigint], bigint>,
}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: ({ IDL }: { IDL: IDL }) => IDL.Type[];
Loading