Skip to content

Latest commit

 

History

History
734 lines (616 loc) · 15.2 KB

ti.api.md

File metadata and controls

734 lines (616 loc) · 15.2 KB

API Report File for "ti-js"

Do not edit this file. It is a report generated by API Extractor.

/// <reference types="jquery" />

// @alpha (undocumented)
const ANS = "ANS";

// @alpha (undocumented)
interface Ans {
    // (undocumented)
    type: typeof ANS;
}

// @alpha (undocumented)
type Assignable = Variable | ListIndex;

// @alpha (undocumented)
const AssignmentStatement = "AssignmentStatement";

// @alpha (undocumented)
interface AssignmentStatement {
    // (undocumented)
    assignable: Assignable;
    // (undocumented)
    type: typeof AssignmentStatement;
    // (undocumented)
    value: ValueExpression;
}

// @alpha (undocumented)
const BinaryExpression = "BinaryExpression";

// @alpha (undocumented)
interface BinaryExpression {
    // (undocumented)
    left: ValueExpression;
    // (undocumented)
    operator: string;
    // (undocumented)
    right: ValueExpression;
    // (undocumented)
    type: typeof BinaryExpression;
}

// @alpha (undocumented)
const ClrHome = "ClrHome";

// @alpha (undocumented)
interface ClrHome {
    // (undocumented)
    type: typeof ClrHome;
}

// @alpha (undocumented)
const ClrTable = "ClrTable";

// @alpha (undocumented)
interface ClrTable {
    // (undocumented)
    type: typeof ClrTable;
}

// @alpha (undocumented)
type CtlStatement = IfStatement | ThenStatement | ElseStatement | ForLoop | WhileLoop | RepeatLoop | EndStatement | PauseStatement | LabelStatement | GotoStatement | IncrementSkip | DecrementSkip | MenuStatement | ProgramStatement | ReturnStatement | StopStatement | DelVarStatement | GraphStyleStatement | OpenLibStatement | ExecLibStatement;

// @alpha (undocumented)
const DecrementSkip = "DecrementSkip";

// @alpha (undocumented)
interface DecrementSkip {
    // (undocumented)
    end: ValueExpression | null;
    // (undocumented)
    type: typeof DecrementSkip;
    // (undocumented)
    variable: Variable | null;
}

// @alpha (undocumented)
const DelVarStatement = "DelVarStatement";

// @alpha (undocumented)
interface DelVarStatement {
    // (undocumented)
    type: typeof DelVarStatement;
    // (undocumented)
    variable: Variable | null;
}

// @alpha (undocumented)
const DispGraph = "DispGraph";

// @alpha (undocumented)
interface DispGraph {
    // (undocumented)
    type: typeof DispGraph;
}

// @alpha (undocumented)
const Display = "Display";

// @alpha (undocumented)
interface Display {
    // (undocumented)
    type: typeof Display;
    // (undocumented)
    value: ValueExpression | null;
}

// @alpha (undocumented)
const DispTable = "DispTable";

// @alpha (undocumented)
interface DispTable {
    // (undocumented)
    type: typeof DispTable;
}

// @alpha (undocumented)
const ElseStatement = "ElseStatement";

// @alpha (undocumented)
interface ElseStatement {
    // (undocumented)
    extra: boolean | null;
    // (undocumented)
    type: typeof ElseStatement;
}

// @alpha (undocumented)
const EmptyStatement = "EmptyStatement";

// @alpha (undocumented)
interface EmptyStatement {
    // (undocumented)
    type: typeof EmptyStatement;
}

// @alpha (undocumented)
const EndStatement = "EndStatement";

// @alpha (undocumented)
interface EndStatement {
    // (undocumented)
    extra: boolean | null;
    // (undocumented)
    type: typeof EndStatement;
}

// @alpha (undocumented)
export function exec(source: string, callback: (output: string) => void): void;

// @alpha (undocumented)
const ExecLibStatement = "ExecLibStatement";

// @alpha (undocumented)
interface ExecLibStatement {
    // (undocumented)
    name: string;
    // (undocumented)
    type: typeof ExecLibStatement;
}

// @alpha (undocumented)
const ForLoop = "ForLoop";

// @alpha (undocumented)
interface ForLoop {
    // (undocumented)
    args: boolean;
    // (undocumented)
    end: ValueExpression | null;
    // (undocumented)
    extra: boolean | null;
    // (undocumented)
    start: ValueExpression | null;
    // (undocumented)
    step: ValueExpression | null;
    // (undocumented)
    type: typeof ForLoop;
    // (undocumented)
    variable: Variable | null;
}

// @alpha (undocumented)
const Get = "Get";

// @alpha (undocumented)
interface Get {
    // (undocumented)
    type: typeof Get;
    // (undocumented)
    variable: Variable | null;
}

// @alpha (undocumented)
const GetCalc = "GetCalc";

// @alpha (undocumented)
interface GetCalc {
    // (undocumented)
    portflag: ValueExpression | null;
    // (undocumented)
    type: typeof GetCalc;
    // (undocumented)
    variable: Variable | null;
}

// @alpha (undocumented)
const GetKey = "GetKey";

// @alpha (undocumented)
interface GetKey {
    // (undocumented)
    type: typeof GetKey;
}

// @alpha (undocumented)
const GotoStatement = "GotoStatement";

// @alpha (undocumented)
interface GotoStatement {
    // (undocumented)
    location: string;
    // (undocumented)
    type: typeof GotoStatement;
}

// @alpha (undocumented)
const GraphStyleStatement = "GraphStyleStatement";

// @alpha (undocumented)
interface GraphStyleStatement {
    // (undocumented)
    equation: ValueExpression | null;
    // (undocumented)
    style: ValueExpression | null;
    // (undocumented)
    type: typeof GraphStyleStatement;
}

// @alpha (undocumented)
const IfStatement = "IfStatement";

// @alpha (undocumented)
interface IfStatement {
    // (undocumented)
    extra: boolean | null;
    // (undocumented)
    type: typeof IfStatement;
    // (undocumented)
    value: ValueExpression | null;
}

// @alpha (undocumented)
const IncrementSkip = "IncrementSkip";

// @alpha (undocumented)
interface IncrementSkip {
    // (undocumented)
    end: ValueExpression | null;
    // (undocumented)
    type: typeof IncrementSkip;
    // (undocumented)
    variable: Variable | null;
}

// @alpha (undocumented)
const Input = "Input";

// @alpha (undocumented)
interface Input {
    // (undocumented)
    text: ValueExpression | null;
    // (undocumented)
    type: typeof Input;
    // (undocumented)
    variable: Variable | null;
}

// @alpha (undocumented)
type IoStatement = Input | Prompt | Display | DispGraph | DispTable | Output | ClrHome | ClrTable | GetCalc | Get | Send;

// @alpha (undocumented)
const LabelStatement = "LabelStatement";

// @alpha (undocumented)
interface LabelStatement {
    // (undocumented)
    location: string;
    // (undocumented)
    type: typeof LabelStatement;
}

// @alpha (undocumented)
interface Line {
    // (undocumented)
    source: string | undefined;
    // (undocumented)
    statement: Statement;
}

// @alpha (undocumented)
const ListIndex = "ListIndex";

// @alpha (undocumented)
interface ListIndex {
    // (undocumented)
    index: ValueExpression;
    // (undocumented)
    list: ListVariable;
    // (undocumented)
    type: typeof ListIndex;
}

// @alpha (undocumented)
interface ListLiteral {
    // (undocumented)
    elements: ValueExpression[];
    // (undocumented)
    resolved: false;
    // (undocumented)
    type: typeof TiList;
}

// @alpha (undocumented)
interface ListResolved {
    // (undocumented)
    elements: NumberResolved[];
    // (undocumented)
    resolved: true;
    // (undocumented)
    type: typeof TiList;
}

// @alpha (undocumented)
const ListVariable = "ListVariable";

// @alpha (undocumented)
interface ListVariable {
    // (undocumented)
    custom: boolean;
    // (undocumented)
    name: string;
    // (undocumented)
    type: typeof ListVariable;
}

// @alpha (undocumented)
const ListVariablePrefix = "List";

// @alpha (undocumented)
interface MenuChoice {
    // (undocumented)
    location: string;
    // (undocumented)
    option: TiString;
}

// @alpha (undocumented)
const MenuStatement = "MenuStatement";

// @alpha (undocumented)
interface MenuStatement {
    // (undocumented)
    choices: MenuChoice[];
    // (undocumented)
    title: ValueExpression | null;
    // (undocumented)
    type: typeof MenuStatement;
}

// @alpha (undocumented)
interface NumberLiteral {
    // (undocumented)
    exponent?: number | null;
    // (undocumented)
    fraction?: number | null;
    // (undocumented)
    integer?: number;
    // (undocumented)
    resolved: false;
    // (undocumented)
    type: typeof TiNumber;
}

// @alpha (undocumented)
interface NumberResolved {
    // (undocumented)
    float: number;
    // (undocumented)
    resolved: true;
    // (undocumented)
    type: typeof TiNumber;
}

// @alpha (undocumented)
const NumberVariable = "NumberVariable";

// @alpha (undocumented)
interface NumberVariable {
    // (undocumented)
    name: string;
    // (undocumented)
    type: typeof NumberVariable;
}

// @alpha (undocumented)
export function on(type: string, listener: () => void): void;

// @alpha (undocumented)
const OpenLibStatement = "OpenLibStatement";

// @alpha (undocumented)
interface OpenLibStatement {
    // (undocumented)
    name: string;
    // (undocumented)
    type: typeof OpenLibStatement;
}

// @alpha (undocumented)
const Output = "Output";

// @alpha (undocumented)
interface Output {
    // (undocumented)
    column: ValueExpression | null;
    // (undocumented)
    row: ValueExpression | null;
    // (undocumented)
    type: typeof Output;
    // (undocumented)
    value: ValueExpression | null;
}

// @alpha (undocumented)
export function parse(source: string, options?: ParseOptions): types.Line[];

// @alpha (undocumented)
export interface ParseOptions {
    // (undocumented)
    sourceMap?: string;
}

// @alpha (undocumented)
const PauseStatement = "PauseStatement";

// @alpha (undocumented)
interface PauseStatement {
    // (undocumented)
    type: typeof PauseStatement;
}

// @alpha (undocumented)
export interface ProgramHandle {
    // (undocumented)
    getStatus(): string;
    // (undocumented)
    isActive(): boolean;
    // (undocumented)
    stop(): void;
}

// @alpha (undocumented)
const ProgramStatement = "ProgramStatement";

// @alpha (undocumented)
interface ProgramStatement {
    // (undocumented)
    name: string;
    // (undocumented)
    type: typeof ProgramStatement;
}

// @alpha (undocumented)
const Prompt = "Prompt";

// @alpha (undocumented)
interface Prompt {
    // (undocumented)
    type: typeof Prompt;
    // (undocumented)
    variable: Variable | null;
}

// @alpha (undocumented)
const RepeatLoop = "RepeatLoop";

// @alpha (undocumented)
interface RepeatLoop {
    // (undocumented)
    extra: boolean | null;
    // (undocumented)
    type: typeof RepeatLoop;
    // (undocumented)
    value: ValueExpression | null;
}

// @alpha (undocumented)
const ReturnStatement = "ReturnStatement";

// @alpha (undocumented)
interface ReturnStatement {
    // (undocumented)
    type: typeof ReturnStatement;
}

// @alpha (undocumented)
export function run(lines: types.Line[], options?: RunOptions): ProgramHandle;

// @alpha (undocumented)
export interface RunOptions {
    // (undocumented)
    callback?: (status: string) => void;
    // (undocumented)
    debug?: boolean;
    // (undocumented)
    elem?: JQuery;
    // (undocumented)
    frequencyMs?: number;
    // (undocumented)
    includeErrors?: boolean;
    // (undocumented)
    includeLibErrors?: boolean;
    // (undocumented)
    includeLineNumbers?: boolean;
    // (undocumented)
    includeSource?: boolean;
    // (undocumented)
    input?: JQuery;
    // (undocumented)
    outputCallback?: (value: string, newline: boolean) => void;
    // (undocumented)
    source?: string | string[];
    // (undocumented)
    stdin?: string;
}

// @alpha (undocumented)
const Send = "Send";

// @alpha (undocumented)
interface Send {
    // (undocumented)
    type: typeof Send;
    // (undocumented)
    variable: Variable | null;
}

// @alpha (undocumented)
type Statement = EmptyStatement | TiSyntaxError | AssignmentStatement | CtlStatement | IoStatement | ValueStatement;

// @alpha (undocumented)
const StopStatement = "StopStatement";

// @alpha (undocumented)
interface StopStatement {
    // (undocumented)
    type: typeof StopStatement;
}

// @alpha (undocumented)
const StringVariable = "StringVariable";

// @alpha (undocumented)
interface StringVariable {
    // (undocumented)
    name: string;
    // (undocumented)
    type: typeof StringVariable;
}

// @alpha (undocumented)
const ThenStatement = "ThenStatement";

// @alpha (undocumented)
interface ThenStatement {
    // (undocumented)
    extra: boolean | null;
    // (undocumented)
    type: typeof ThenStatement;
}

// @alpha (undocumented)
const TiList = "TiList";

// @alpha (undocumented)
type TiList = ListLiteral | ListResolved;

// @alpha (undocumented)
const TiNumber = "TiNumber";

// @alpha (undocumented)
type TiNumber = NumberLiteral | NumberResolved;

// @alpha (undocumented)
const TiString = "TiString";

// @alpha (undocumented)
interface TiString {
    // (undocumented)
    chars: string;
    // (undocumented)
    type: typeof TiString;
}

// @alpha (undocumented)
const TiSyntaxError = "TiSyntaxError";

// @alpha (undocumented)
interface TiSyntaxError {
    // (undocumented)
    type: typeof TiSyntaxError;
}

declare namespace types {
    export {
        TiSyntaxError,
        TiNumber,
        NumberLiteral,
        NumberResolved,
        TiString,
        ListVariablePrefix,
        TiList,
        ListLiteral,
        ListResolved,
        ValueResolved,
        ANS,
        Ans,
        GetKey,
        NumberVariable,
        StringVariable,
        ListVariable,
        ListIndex,
        Variable,
        Assignable,
        BinaryExpression,
        UnaryExpression,
        ValueExpression,
        EmptyStatement,
        ValueStatement,
        AssignmentStatement,
        IfStatement,
        ThenStatement,
        ElseStatement,
        ForLoop,
        WhileLoop,
        RepeatLoop,
        EndStatement,
        PauseStatement,
        LabelStatement,
        GotoStatement,
        IncrementSkip,
        DecrementSkip,
        MenuChoice,
        MenuStatement,
        ProgramStatement,
        ReturnStatement,
        StopStatement,
        DelVarStatement,
        GraphStyleStatement,
        OpenLibStatement,
        ExecLibStatement,
        CtlStatement,
        Input,
        Prompt,
        Display,
        DispGraph,
        DispTable,
        Output,
        ClrHome,
        ClrTable,
        GetCalc,
        Get,
        Send,
        IoStatement,
        Statement,
        Line
    }
}
export { types }

// @alpha (undocumented)
const UnaryExpression = "UnaryExpression";

// @alpha (undocumented)
interface UnaryExpression {
    // (undocumented)
    argument: ValueExpression;
    // (undocumented)
    operator: string;
    // (undocumented)
    type: typeof UnaryExpression;
}

// @alpha (undocumented)
type ValueExpression = TiNumber | TiString | TiList | Assignable | BinaryExpression | UnaryExpression | TiSyntaxError | Ans | GetKey;

// @alpha (undocumented)
type ValueResolved = NumberResolved | TiString | ListResolved;

// @alpha (undocumented)
const ValueStatement = "ValueStatement";

// @alpha (undocumented)
interface ValueStatement {
    // (undocumented)
    type: typeof ValueStatement;
    // (undocumented)
    value: ValueExpression;
}

// @alpha (undocumented)
type Variable = NumberVariable | StringVariable | ListVariable;

// @alpha (undocumented)
const WhileLoop = "WhileLoop";

// @alpha (undocumented)
interface WhileLoop {
    // (undocumented)
    extra: boolean | null;
    // (undocumented)
    type: typeof WhileLoop;
    // (undocumented)
    value: ValueExpression | null;
}