@glimmer/runtime
Version:
Minimal runtime needed to render Glimmer templates
43 lines • 1.42 kB
TypeScript
import { Dict, Maybe, Op, Option, RuntimeOp } from '@glimmer/interfaces';
import { LowLevelVM, VM } from './vm';
import { InternalVM } from './vm/append';
export interface OpcodeJSON {
type: number | string;
guid?: Option<number>;
deopted?: boolean;
args?: string[];
details?: Dict<Option<string>>;
children?: OpcodeJSON[];
}
export declare type Operand1 = number;
export declare type Operand2 = number;
export declare type Operand3 = number;
export declare type Syscall = (vm: InternalVM, opcode: RuntimeOp) => void;
export declare type MachineOpcode = (vm: LowLevelVM, opcode: RuntimeOp) => void;
export declare type Evaluate = {
syscall: true;
evaluate: Syscall;
} | {
syscall: false;
evaluate: MachineOpcode;
};
export declare type DebugState = {
pc: number;
sp: number;
type: number;
isMachine: 0 | 1;
size: number;
params?: Maybe<Dict>;
name?: string;
state: unknown;
};
export declare class AppendOpcodes {
private evaluateOpcode;
add<Name extends Op>(name: Name, evaluate: Syscall): void;
add<Name extends Op>(name: Name, evaluate: MachineOpcode, kind: 'machine'): void;
debugBefore(vm: VM, opcode: RuntimeOp): DebugState;
debugAfter(vm: VM, pre: DebugState): void;
evaluate(vm: VM, opcode: RuntimeOp, type: number): void;
}
export declare const APPEND_OPCODES: AppendOpcodes;
//# sourceMappingURL=opcodes.d.ts.map