-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathruby-js-ruby-runtime.d.ts
More file actions
36 lines (35 loc) · 1.43 KB
/
ruby-js-ruby-runtime.d.ts
File metadata and controls
36 lines (35 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/** @module Interface ruby:js/ruby-runtime **/
export function rubyShowVersion(): void;
export function rubyInit(args: Array<string>): void;
export function rubyInitLoadpath(): void;
export function rbEvalStringProtect(str: string): [RbAbiValue, number];
export function rbFuncallvProtect(recv: RbAbiValue, mid: RbId, args: Array<RbAbiValue>): [RbAbiValue, number];
export function rbIntern(name: string): RbId;
export function rbErrinfo(): RbAbiValue;
export function rbClearErrinfo(): void;
export function rstringPtr(value: RbAbiValue): string;
export function rbVmBugreport(): void;
export function rbGcEnable(): boolean;
export function rbGcDisable(): boolean;
export function rbSetShouldProhibitRewind(newValue: boolean): boolean;
/**
* XXX: Do we really need them?
* wrap-js-value: func(value: js-abi-value) -> rb-abi-value;
* to-js-value: func(value: borrow<rb-abi-value>) -> js-abi-value;
* Transfer the value from Ruby to JS
*
* 1. Ruby side registers the value in the stage
* 2. Ruby side calls JS's `import-rb-value-from-rb()`
* 3. `import-rb-value-from-rb()` calls `export-rb-value-to-js()`
* 4. `export-rb-value-to-js()` returns the staged value
*/
export function exportRbValueToJs(): RbAbiValue;
export type JsAbiValue = import('./ruby-js-js-runtime.js').JsAbiValue;
export type RbErrno = number;
export type RbId = number;
export class RbAbiValue {
/**
* This type does not have a public constructor.
*/
private constructor();
}