mathjslab
Version:
MathJSLab - An interpreter with language syntax like MATLAB®/Octave, ISBN 978-65-00-82338-7.
68 lines (67 loc) • 2.53 kB
TypeScript
import type { ClassMethodDefinition as ClassMethodDefinitionBase } from './ClassMember';
import type { ClassDefinition } from './ClassDefinition';
import type { RuntimeDisplay } from './RuntimeDisplay';
type ClassMethodDefinition = ClassMethodDefinitionBase<ClassDefinition>;
/**
* Runtime value representing a static class method selected from a class.
*/
declare class ClassStaticMethod {
/** Runtime type tag used by interpreter predicates. */
static readonly CLASS_STATIC_METHOD = 9;
/** Runtime type tag stored on the static method wrapper. */
readonly type = 9;
/** Optional AST-style parent pointer used by generic value handling. */
parent?: unknown;
/** Class that owns the static method. */
readonly classDefinition: ClassDefinition;
/** Static method metadata. */
readonly method: ClassMethodDefinition;
/**
* Test whether a value is a static class method wrapper.
*
* @param obj Value to test.
* @returns `true` when `obj` is a `ClassStaticMethod`.
*/
static readonly isInstanceOf: (obj: unknown) => obj is ClassStaticMethod;
/**
* Create a static method wrapper.
*
* @param classDefinition Owning class metadata.
* @param method Static method metadata.
*/
constructor(classDefinition: ClassDefinition, method: ClassMethodDefinition);
/**
* Bind a static method to its owning class.
*
* @param classDefinition Owning class metadata.
* @param method Static method metadata.
* @returns Static method wrapper.
*/
static readonly bind: (classDefinition: ClassDefinition, method: ClassMethodDefinition) => ClassStaticMethod;
/**
* Copy a static method wrapper.
*
* @param staticMethod Static method wrapper to copy.
* @returns New static method wrapper.
*/
static readonly copy: (staticMethod: ClassStaticMethod) => ClassStaticMethod;
/**
* Render a compact static method summary.
*
* @param staticMethod Static method wrapper to render.
* @param _interpreter Interpreter requesting unparse.
* @returns Human-readable method summary.
*/
static readonly unparse: (staticMethod: ClassStaticMethod, _interpreter: RuntimeDisplay) => string;
/**
* Copy this static method wrapper.
*
* @returns New static method wrapper.
*/
copy(): ClassStaticMethod;
}
export { ClassStaticMethod };
declare const _default: {
ClassStaticMethod: typeof ClassStaticMethod;
};
export default _default;