skia2/experimental/tskit/bindings/embind.d.ts
Kevin Lubick 38320680cb [canvaskit] Proof of Concept for Typescript-build structure
This CL demonstrates the following
 - Interface code written in TS
 - Having support for modular builds (e.g. making Paragraph
   optional)
 - Avoiding monolithic interface files
 - Using eslint to enforce style and avoid errors.
 - Working debug and release build (using example.html)

Many of these files would be generated via a tool (that
has not been written yet).

go/ts-canvaskit

Change-Id: Ibe9a214d5897b09920cef01f6e95302f3cf30d5c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/392297
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-04-09 19:01:49 +00:00

25 lines
578 B
TypeScript

declare namespace embind {
export interface EmbindModule {
// The following are provided by emscripten
onRuntimeInitialized(): void;
_malloc(bytes: number): number;
_free(ptr: number): void;
HEAPF32: Float32Array;
HEAPU8: Uint8Array;
HEAPU16: Uint16Array;
HEAPU32: Uint32Array;
HEAP8: Int8Array;
HEAP16: Int16Array;
HEAP32: Int32Array;
}
export interface EmbindObject<T extends EmbindObject<T>> {
clone(): T;
delete(): void;
deleteAfter(): void;
isAliasOf(other: any): boolean;
isDeleted(): boolean;
}
}