UNPKG

mathjslab

Version:

MathJSLab - An interpreter with language syntax like MATLAB®/Octave, ISBN 978-65-00-82338-7.

62 lines (61 loc) 2.11 kB
import type { ClassDefinition } from './ClassDefinition'; import type { RuntimeDisplay } from './RuntimeDisplay'; /** * Runtime value for the built-in `ClassName.empty` static method. */ declare class ClassEmptyMethod { /** Runtime type tag used by interpreter predicates. */ static readonly CLASS_EMPTY_METHOD = 14; /** Runtime type tag stored on the empty-method wrapper. */ readonly type = 14; /** Optional AST-style parent pointer used by generic value handling. */ parent?: unknown; /** Class that owns the `empty` method. */ readonly classDefinition: ClassDefinition; /** * Test whether a value is a built-in class empty-method wrapper. * * @param obj Value to test. * @returns `true` when `obj` is a `ClassEmptyMethod`. */ static readonly isInstanceOf: (obj: unknown) => obj is ClassEmptyMethod; /** * Create an empty-method wrapper for a class. * * @param classDefinition Owning class metadata. */ constructor(classDefinition: ClassDefinition); /** * Bind the built-in `empty` method to a class. * * @param classDefinition Owning class metadata. * @returns Empty-method wrapper. */ static readonly bind: (classDefinition: ClassDefinition) => ClassEmptyMethod; /** * Copy an empty-method wrapper. * * @param emptyMethod Wrapper to copy. * @returns New empty-method wrapper. */ static readonly copy: (emptyMethod: ClassEmptyMethod) => ClassEmptyMethod; /** * Render a compact empty-method summary. * * @param emptyMethod Wrapper to render. * @param _interpreter Interpreter requesting unparse. * @returns Human-readable method summary. */ static readonly unparse: (emptyMethod: ClassEmptyMethod, _interpreter: RuntimeDisplay) => string; /** * Copy this empty-method wrapper. * * @returns New empty-method wrapper. */ copy(): ClassEmptyMethod; } export { ClassEmptyMethod }; declare const _default: { ClassEmptyMethod: typeof ClassEmptyMethod; }; export default _default;