mathjslab
Version:
MathJSLab - An interpreter with language syntax like MATLAB®/Octave, ISBN 978-65-00-82338-7.
69 lines (68 loc) • 2.5 kB
TypeScript
import type { RuntimeExpressionValue } from './AST';
import type { ClassInstance } from './ClassInstance';
import { ClassEventData } from './ClassEventData';
import type { RuntimeDisplay } from './RuntimeDisplay';
/**
* Runtime value compatible with MATLAB's `event.PropertyEvent` shape.
*/
declare class ClassPropertyEvent extends ClassEventData {
/** Runtime type tag used by interpreter predicates. */
static readonly CLASS_PROPERTY_EVENT = 13;
/** Runtime type tag stored on property event data objects. */
readonly type: number;
/** Name of the property that raised the event. */
readonly propertyName: string;
/** Object whose property changed or was observed. */
readonly affectedObject: ClassInstance;
/**
* Test whether a value is property event data.
*
* @param obj Value to test.
* @returns `true` when `obj` is a `ClassPropertyEvent`.
*/
static readonly isInstanceOf: (obj: unknown) => obj is ClassPropertyEvent;
/**
* Create property event data.
*
* @param source Object whose property raised the event.
* @param propertyName Property name.
*/
constructor(source: ClassInstance, propertyName: string);
/**
* Create property event data.
*
* @param source Object whose property raised the event.
* @param propertyName Property name.
* @returns Runtime property event data object.
*/
static readonly create: (source: ClassInstance, propertyName: string) => ClassPropertyEvent;
/**
* Read a public property event field.
*
* @param eventData Event data object.
* @param field Field name.
* @returns Field value, if supported.
*/
static readonly getProperty: (eventData: ClassEventData, field: string) => RuntimeExpressionValue | undefined;
/**
* Render a compact property event summary.
*
* @param eventData Event data object.
* @param _interpreter Interpreter requesting unparse.
* @returns Human-readable event data summary.
*/
static readonly unparse: (eventData: ClassEventData, _interpreter: RuntimeDisplay) => string;
/**
* Copy property event data.
*
* Property event data objects are immutable in the current runtime.
*
* @returns This property event data object.
*/
copy(): ClassPropertyEvent;
}
export { ClassPropertyEvent };
declare const _default: {
ClassPropertyEvent: typeof ClassPropertyEvent;
};
export default _default;