This file contains hidden or 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
#![feature(unsized_locals)] | |
use memmap::MmapOptions; | |
use neon::prelude::*; | |
use std::cmp; | |
use std::f32; | |
use std::fs::File; | |
fn parse_image(mut cx: FunctionContext) -> JsResult<JsNull> { | |
let file_path_arg: Handle<JsString> = cx.argument::<JsString>(0).unwrap(); | |
let file_path = file_path_arg.value(&mut cx); |
This file contains hidden or 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
export interface PromptAttributes { | |
text: string; | |
// Use the native key hash to set the control | |
control: number; | |
mode?: "standard" | "hold" | "mash" | "mash_infinite"; | |
mashAmount?: number; | |
// When using mash mode this function is called indefinitely, make sure to either handle this properly | |
// Or to utilise "once" from Lodash for example to make sure the function is only called once. | |
onSuccess: Function; | |
// Only called during mash mode. |
This file contains hidden or 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
const fetchMachine = Machine({ | |
id: 'fetch', | |
initial: 'preprocessing', | |
context: { | |
retries: 0, | |
}, | |
states: { | |
preprocessing: { | |
on: { | |
ERROR: 'manualIntervention', |