diff --git a/rust/candid_parser/src/bindings/typescript.rs b/rust/candid_parser/src/bindings/typescript.rs index a93df74e..1f4f3bfc 100644 --- a/rust/candid_parser/src/bindings/typescript.rs +++ b/rust/candid_parser/src/bindings/typescript.rs @@ -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()) diff --git a/rust/candid_parser/tests/assets/ok/actor.d.ts b/rust/candid_parser/tests/assets/ok/actor.d.ts index 5d1664c8..7e88ad9b 100644 --- a/rust/candid_parser/tests/assets/ok/actor.d.ts +++ b/rust/candid_parser/tests/assets/ok/actor.d.ts @@ -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[]; diff --git a/rust/candid_parser/tests/assets/ok/class.d.ts b/rust/candid_parser/tests/assets/ok/class.d.ts index 609a84e0..5cbc5acb 100644 --- a/rust/candid_parser/tests/assets/ok/class.d.ts +++ b/rust/candid_parser/tests/assets/ok/class.d.ts @@ -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[]; diff --git a/rust/candid_parser/tests/assets/ok/cyclic.d.ts b/rust/candid_parser/tests/assets/ok/cyclic.d.ts index ae0959f2..d75b132a 100644 --- a/rust/candid_parser/tests/assets/ok/cyclic.d.ts +++ b/rust/candid_parser/tests/assets/ok/cyclic.d.ts @@ -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[]; diff --git a/rust/candid_parser/tests/assets/ok/empty.d.ts b/rust/candid_parser/tests/assets/ok/empty.d.ts index 2a8b36a6..e01c5afb 100644 --- a/rust/candid_parser/tests/assets/ok/empty.d.ts +++ b/rust/candid_parser/tests/assets/ok/empty.d.ts @@ -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[]; diff --git a/rust/candid_parser/tests/assets/ok/escape.d.ts b/rust/candid_parser/tests/assets/ok/escape.d.ts index 06041ba2..54eaf207 100644 --- a/rust/candid_parser/tests/assets/ok/escape.d.ts +++ b/rust/candid_parser/tests/assets/ok/escape.d.ts @@ -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[]; diff --git a/rust/candid_parser/tests/assets/ok/example.d.ts b/rust/candid_parser/tests/assets/ok/example.d.ts index d04234de..56722625 100644 --- a/rust/candid_parser/tests/assets/ok/example.d.ts +++ b/rust/candid_parser/tests/assets/ok/example.d.ts @@ -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[]; diff --git a/rust/candid_parser/tests/assets/ok/fieldnat.d.ts b/rust/candid_parser/tests/assets/ok/fieldnat.d.ts index 2f2074fa..53e68afe 100644 --- a/rust/candid_parser/tests/assets/ok/fieldnat.d.ts +++ b/rust/candid_parser/tests/assets/ok/fieldnat.d.ts @@ -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[]; diff --git a/rust/candid_parser/tests/assets/ok/keyword.d.ts b/rust/candid_parser/tests/assets/ok/keyword.d.ts index a2e5b060..22d1c24a 100644 --- a/rust/candid_parser/tests/assets/ok/keyword.d.ts +++ b/rust/candid_parser/tests/assets/ok/keyword.d.ts @@ -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[]; diff --git a/rust/candid_parser/tests/assets/ok/management.d.ts b/rust/candid_parser/tests/assets/ok/management.d.ts index 1455fa09..ca60e354 100644 --- a/rust/candid_parser/tests/assets/ok/management.d.ts +++ b/rust/candid_parser/tests/assets/ok/management.d.ts @@ -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[]; diff --git a/rust/candid_parser/tests/assets/ok/recursion.d.ts b/rust/candid_parser/tests/assets/ok/recursion.d.ts index 7b8f1f5e..062ef95a 100644 --- a/rust/candid_parser/tests/assets/ok/recursion.d.ts +++ b/rust/candid_parser/tests/assets/ok/recursion.d.ts @@ -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[]; diff --git a/rust/candid_parser/tests/assets/ok/recursive_class.d.ts b/rust/candid_parser/tests/assets/ok/recursive_class.d.ts index 8fa267da..ba2ef3fd 100644 --- a/rust/candid_parser/tests/assets/ok/recursive_class.d.ts +++ b/rust/candid_parser/tests/assets/ok/recursive_class.d.ts @@ -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[]; diff --git a/rust/candid_parser/tests/assets/ok/service.d.ts b/rust/candid_parser/tests/assets/ok/service.d.ts index da5e1ad3..57c3c871 100644 --- a/rust/candid_parser/tests/assets/ok/service.d.ts +++ b/rust/candid_parser/tests/assets/ok/service.d.ts @@ -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[]; diff --git a/rust/candid_parser/tests/assets/ok/unicode.d.ts b/rust/candid_parser/tests/assets/ok/unicode.d.ts index ed34dc13..1e559610 100644 --- a/rust/candid_parser/tests/assets/ok/unicode.d.ts +++ b/rust/candid_parser/tests/assets/ok/unicode.d.ts @@ -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[];