Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3047b38
commit b797c1e
Showing
14 changed files
with
278 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
declare function peg$SyntaxError(message: any, expected: any, found: any, location: any): void; | ||
declare namespace peg$SyntaxError { | ||
var buildMessage: (expected: any, found: any) => string; | ||
} | ||
declare function peg$parse(input: any, options: any): any; | ||
export { peg$SyntaxError as SyntaxError, peg$parse as parse }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
declare type StateType = string; | ||
import { JssmGenericState, JssmGenericConfig, JssmTransition, JssmTransitionList, JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmArrow, JssmArrowDirection, JssmArrowKind, JssmLayout, FslDirection, FslTheme } from './jssm_types'; | ||
import { seq, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key } from './jssm_util'; | ||
import { parse } from './jssm-dot'; | ||
import { version } from './version'; | ||
declare function arrow_direction(arrow: JssmArrow): JssmArrowDirection; | ||
declare function arrow_left_kind(arrow: JssmArrow): JssmArrowKind; | ||
declare function arrow_right_kind(arrow: JssmArrow): JssmArrowKind; | ||
declare function compile<mDT>(tree: JssmParseTree): JssmGenericConfig<mDT>; | ||
declare function make<mDT>(plan: string): JssmGenericConfig<mDT>; | ||
declare function transfer_state_properties(state_decl: JssmStateDeclaration): JssmStateDeclaration; | ||
declare class Machine<mDT> { | ||
_state: StateType; | ||
_states: Map<StateType, JssmGenericState>; | ||
_edges: Array<JssmTransition<mDT>>; | ||
_edge_map: Map<StateType, Map<StateType, number>>; | ||
_named_transitions: Map<StateType, number>; | ||
_actions: Map<StateType, Map<StateType, number>>; | ||
_reverse_actions: Map<StateType, Map<StateType, number>>; | ||
_reverse_action_targets: Map<StateType, Map<StateType, number>>; | ||
_machine_author?: Array<string>; | ||
_machine_comment?: string; | ||
_machine_contributor?: Array<string>; | ||
_machine_definition?: string; | ||
_machine_language?: string; | ||
_machine_license?: string; | ||
_machine_name?: string; | ||
_machine_version?: string; | ||
_fsl_version?: string; | ||
_raw_state_declaration?: Array<Object>; | ||
_state_declarations: Map<StateType, JssmStateDeclaration>; | ||
_graph_layout: JssmLayout; | ||
_dot_preamble: string; | ||
_arrange_declaration: Array<Array<StateType>>; | ||
_arrange_start_declaration: Array<Array<StateType>>; | ||
_arrange_end_declaration: Array<Array<StateType>>; | ||
_theme: FslTheme; | ||
_flow: FslDirection; | ||
constructor({ start_states, complete, transitions, machine_author, machine_comment, machine_contributor, machine_definition, machine_language, machine_license, machine_name, machine_version, state_declaration, fsl_version, dot_preamble, arrange_declaration, arrange_start_declaration, arrange_end_declaration, theme, flow, graph_layout }: JssmGenericConfig<mDT>); | ||
_new_state(state_config: JssmGenericState): StateType; | ||
state(): StateType; | ||
state_is_final(whichState: StateType): boolean; | ||
is_final(): boolean; | ||
graph_layout(): string; | ||
dot_preamble(): string; | ||
machine_author(): Array<string>; | ||
machine_comment(): string; | ||
machine_contributor(): Array<string>; | ||
machine_definition(): string; | ||
machine_language(): string; | ||
machine_license(): string; | ||
machine_name(): string; | ||
machine_version(): string; | ||
raw_state_declarations(): Array<Object>; | ||
state_declaration(which: StateType): JssmStateDeclaration; | ||
state_declarations(): Map<StateType, Object>; | ||
fsl_version(): string; | ||
machine_state(): JssmMachineInternalState<mDT>; | ||
states(): Array<StateType>; | ||
state_for(whichState: StateType): JssmGenericState; | ||
has_state(whichState: StateType): boolean; | ||
list_edges(): Array<JssmTransition<mDT>>; | ||
list_named_transitions(): Map<StateType, number>; | ||
list_actions(): Array<StateType>; | ||
theme(): FslTheme; | ||
flow(): FslDirection; | ||
get_transition_by_state_names(from: StateType, to: StateType): number; | ||
lookup_transition_for(from: StateType, to: StateType): JssmTransition<mDT>; | ||
list_transitions(whichState?: StateType): JssmTransitionList; | ||
list_entrances(whichState?: StateType): Array<StateType>; | ||
list_exits(whichState?: StateType): Array<StateType>; | ||
probable_exits_for(whichState: StateType): Array<JssmTransition<mDT>>; | ||
probabilistic_transition(): boolean; | ||
probabilistic_walk(n: number): Array<StateType>; | ||
probabilistic_histo_walk(n: number): Map<StateType, number>; | ||
actions(whichState?: StateType): Array<StateType>; | ||
list_states_having_action(whichState: StateType): Array<StateType>; | ||
list_exit_actions(whichState?: StateType): Array<StateType>; | ||
probable_action_exits(whichState?: StateType): Array<any>; | ||
is_unenterable(whichState: StateType): boolean; | ||
has_unenterables(): boolean; | ||
is_terminal(): boolean; | ||
state_is_terminal(whichState: StateType): boolean; | ||
has_terminals(): boolean; | ||
is_complete(): boolean; | ||
state_is_complete(whichState: StateType): boolean; | ||
has_completes(): boolean; | ||
action(name: StateType, newData?: mDT): boolean; | ||
transition(newState: StateType, newData?: mDT): boolean; | ||
force_transition(newState: StateType, newData?: mDT): boolean; | ||
current_action_for(action: StateType): number; | ||
current_action_edge_for(action: StateType): JssmTransition<mDT>; | ||
valid_action(action: StateType, _newData?: mDT): boolean; | ||
valid_transition(newState: StateType, _newData?: mDT): boolean; | ||
valid_force_transition(newState: StateType, _newData?: mDT): boolean; | ||
sm(template_strings: Array<string>, ...remainder: any[]): Machine<mDT>; | ||
} | ||
declare function sm<mDT>(template_strings: Array<string>, ...remainder: any[]): Machine<mDT>; | ||
export { version, transfer_state_properties, Machine, make, parse, compile, sm, arrow_direction, arrow_left_kind, arrow_right_kind, seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
declare type StateType = string; | ||
declare type JssmSuccess = { | ||
success: true; | ||
}; | ||
declare type JssmFailure = { | ||
success: false; | ||
error: any; | ||
}; | ||
declare type JssmIncomplete = { | ||
success: 'incomplete'; | ||
}; | ||
declare type JssmResult = JssmSuccess | JssmFailure | JssmIncomplete; | ||
declare type JssmColor = string; | ||
declare type JssmPermitted = 'required' | 'disallowed'; | ||
declare type JssmPermittedOpt = 'required' | 'disallowed' | 'optional'; | ||
declare type JssmArrow = '->' | '<->' | '<=->' | '<~->' | '=>' | '<=>' | '<-=>' | '<~=>' | '~>' | '<~>' | '<-~>' | '<=~>'; | ||
declare type JssmShape = "box" | "polygon" | "ellipse" | "oval" | "circle" | "point" | "egg" | "triangle" | "plaintext" | "plain" | "diamond" | "trapezium" | "parallelogram" | "house" | "pentagon" | "hexagon" | "septagon" | "octagon" | "doublecircle" | "doubleoctagon" | "tripleoctagon" | "invtriangle" | "invtrapezium" | "invhouse" | "Mdiamond" | "Msquare" | "Mcircle" | "rect" | "rectangle" | "square" | "star" | "none" | "underline" | "cylinder" | "note" | "tab" | "folder" | "box3d" | "component" | "promoter" | "cds" | "terminator" | "utr" | "primersite" | "restrictionsite" | "fivepoverhang" | "threepoverhang" | "noverhang" | "assembly" | "signature" | "insulator" | "ribosite" | "rnastab" | "proteasesite" | "proteinstab" | "rpromoter" | "rarrow" | "larrow" | "lpromoter" | "record"; | ||
declare type JssmArrowDirection = 'left' | 'right' | 'both'; | ||
declare type JssmArrowKind = 'none' | 'legal' | 'main' | 'forced'; | ||
declare type JssmLayout = 'dot' | 'circo' | 'twopi' | 'fdp'; | ||
declare type JssmCorner = 'regular' | 'rounded' | 'lined'; | ||
declare type JssmLineStyle = 'solid' | 'dashed' | 'dotted'; | ||
declare type FslDirection = 'up' | 'right' | 'down' | 'left'; | ||
declare type FslTheme = 'default' | 'ocean' | 'modern' | 'none'; | ||
declare type JssmTransitionPermitter<DataType> = (OldState: StateType, NewState: StateType, OldData: DataType, NewData: DataType) => boolean; | ||
declare type JssmTransitionPermitterMaybeArray<DataType> = JssmTransitionPermitter<DataType> | Array<JssmTransitionPermitter<DataType>>; | ||
declare type JssmTransition<DataType> = { | ||
from: StateType; | ||
to: StateType; | ||
name?: string; | ||
action?: StateType; | ||
check?: JssmTransitionPermitterMaybeArray<DataType>; | ||
probability?: number; | ||
kind: JssmArrowKind; | ||
forced_only: boolean; | ||
main_path: boolean; | ||
}; | ||
declare type JssmTransitions<DataType> = Array<JssmTransition<DataType>>; | ||
declare type JssmTransitionList = { | ||
entrances: Array<StateType>; | ||
exits: Array<StateType>; | ||
}; | ||
declare type JssmTransitionCycle = { | ||
key: 'cycle'; | ||
value: StateType; | ||
}; | ||
declare type JssmTransitionRule = StateType | JssmTransitionCycle; | ||
declare type JssmGenericState = { | ||
from: Array<StateType>; | ||
name: StateType; | ||
to: Array<StateType>; | ||
complete: boolean; | ||
}; | ||
declare type JssmMachineInternalState<DataType> = { | ||
internal_state_impl_version: 1; | ||
state: StateType; | ||
states: Map<StateType, JssmGenericState>; | ||
named_transitions: Map<StateType, number>; | ||
edge_map: Map<StateType, Map<StateType, number>>; | ||
actions: Map<StateType, Map<StateType, number>>; | ||
reverse_actions: Map<StateType, Map<StateType, number>>; | ||
edges: Array<JssmTransition<DataType>>; | ||
}; | ||
declare type JssmStatePermitter<DataType> = (OldState: StateType, NewState: StateType, OldData: DataType, NewData: DataType) => boolean; | ||
declare type JssmStatePermitterMaybeArray<DataType> = JssmStatePermitter<DataType> | Array<JssmStatePermitter<DataType>>; | ||
declare type JssmGenericMachine<DataType> = { | ||
name?: string; | ||
state: StateType; | ||
data?: DataType; | ||
nodes?: Array<StateType>; | ||
transitions: JssmTransitions<DataType>; | ||
check?: JssmStatePermitterMaybeArray<DataType>; | ||
min_transitions?: number; | ||
max_transitions?: number; | ||
allow_empty?: boolean; | ||
allow_islands?: boolean; | ||
allow_force?: boolean; | ||
keep_history?: boolean | number; | ||
}; | ||
declare type JssmStateDeclarationRule = { | ||
key: string; | ||
value: any; | ||
}; | ||
declare type JssmStateDeclaration = { | ||
declarations: Array<JssmStateDeclarationRule>; | ||
shape?: JssmShape; | ||
color?: JssmColor; | ||
corners?: JssmCorner; | ||
linestyle?: JssmLineStyle; | ||
textColor?: JssmColor; | ||
backgroundColor?: JssmColor; | ||
borderColor?: JssmColor; | ||
state: StateType; | ||
}; | ||
declare type JssmGenericConfig<DataType> = { | ||
graph_layout?: JssmLayout; | ||
complete?: Array<StateType>; | ||
transitions: JssmTransitions<DataType>; | ||
theme?: FslTheme; | ||
flow?: FslDirection; | ||
name?: string; | ||
data?: DataType; | ||
nodes?: Array<StateType>; | ||
check?: JssmStatePermitterMaybeArray<DataType>; | ||
min_exits?: number; | ||
max_exits?: number; | ||
allow_islands?: false; | ||
allow_force?: false; | ||
actions?: JssmPermittedOpt; | ||
simplify_bidi?: boolean; | ||
dot_preamble?: string; | ||
start_states: Array<StateType>; | ||
end_states?: Array<StateType>; | ||
state_declaration?: Array<Object>; | ||
arrange_declaration?: Array<Array<StateType>>; | ||
arrange_start_declaration?: Array<Array<StateType>>; | ||
arrange_end_declaration?: Array<Array<StateType>>; | ||
machine_author?: string | Array<string>; | ||
machine_comment?: string; | ||
machine_contributor?: string | Array<string>; | ||
machine_definition?: string; | ||
machine_language?: string; | ||
machine_license?: string; | ||
machine_name?: string; | ||
machine_version?: string; | ||
fsl_version?: string; | ||
auto_api?: boolean | string; | ||
}; | ||
declare type JssmCompileRule = { | ||
agg_as: string; | ||
val: any; | ||
}; | ||
declare type JssmCompileSe = { | ||
to: StateType; | ||
se: JssmCompileSe; | ||
kind: JssmArrow; | ||
l_action?: StateType; | ||
r_action?: StateType; | ||
l_probability: number; | ||
r_probability: number; | ||
}; | ||
declare type JssmCompileSeStart<DataType> = { | ||
from: DataType; | ||
se: JssmCompileSe; | ||
key: string; | ||
value?: string | number; | ||
name?: string; | ||
}; | ||
declare type JssmParseTree = Array<JssmCompileSeStart<StateType>>; | ||
declare type JssmParseFunctionType = (string: any) => JssmParseTree; | ||
export { JssmColor, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmLayout, JssmParseFunctionType, JssmMachineInternalState, FslDirection, FslTheme }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
declare const array_box_if_string: (n: any) => any; | ||
declare const weighted_rand_select: Function; | ||
declare const seq: Function; | ||
declare const histograph: Function; | ||
declare const weighted_sample_select: Function; | ||
declare const weighted_histo_key: Function; | ||
export { seq, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
const version: string = "5.31.0"; | ||
const version: string = "5.31.1"; | ||
export { version }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const version: string; | ||
export { version }; |