mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-19 05:29:46 +08:00
- Add a strict versioned manifest and direct C ABI lowering for both backends. - Link declared native inputs through the CLI and compiler APIs with precise diagnostics. - Cover the ABI under plain and sanitized integration tests and document its contracts.
18 lines
762 B
TypeScript
18 lines
762 B
TypeScript
declare function nativeScale(value: number): number;
|
|
declare function nativeInvert(value: boolean): boolean;
|
|
declare function nativeU8(value: number): number;
|
|
declare function nativeU32(value: number): number;
|
|
declare function nativeI32(value: number): number;
|
|
declare function nativeTextSum(value: string): number;
|
|
declare function nativeBytesSum(value: Uint8Array): number;
|
|
declare function nativeNote(value: number): void;
|
|
declare function nativeLastNote(): number;
|
|
|
|
console.log(nativeScale(21));
|
|
console.log(nativeInvert(false), nativeInvert(true));
|
|
console.log(nativeU8(258), nativeU32(-1), nativeI32(4294967295));
|
|
console.log(nativeTextSum("A\0é"));
|
|
console.log(nativeBytesSum(new Uint8Array([1, 2, 3])));
|
|
nativeNote(12.5);
|
|
console.log(nativeLastNote());
|