Skip to content

@temporary-escape/mod-sdk / InitCallback

Type Alias: InitCallback ​

ts
type InitCallback = (runtime: Runtime) => void;

Defined in: init.ts:20

An init callback, invoked with the Runtime the module is running in. Must be a module-level function (or a top-level arrow referencing only module-level values); AssemblyScript 0.28.20 does not implement closures that capture function locals.

NOTE: the parameter is required by AssemblyScript 0.28.20, which miscompiles zero-parameter () => void function references (it emits call_indirect with a () -> i32 type and traps with "indirect call type mismatch"). A one-parameter (runtime: Runtime) => void signature is emitted correctly, matching the SDK's existing SignalCallback<T> pattern.

Parameters ​

ParameterType
runtimeRuntime

Returns ​

void