code
stringlengths
10
343k
docstring
stringlengths
36
21.9k
func_name
stringlengths
1
3.35k
language
stringclasses
1 value
repo
stringlengths
7
58
path
stringlengths
4
131
url
stringlengths
44
195
license
stringclasses
5 values
export function getUnpackAndPreprocessInputShader(gpgpu, inputShapeRC, useFloatTextures) { let setOutputSnippet; if (useFloatTextures) { setOutputSnippet = ` void setOutput(float decodedValue) { gl_FragColor = vec4(decodedValue, 0, 0, 0); } `; } else { setOutputSnippet = ` const vec4 floatPowers = vec4( 1.0, 255.0, 255.0 * 255.0, 255.0 * 255.0 * 255.0 ); const float maxValue = 20000.0; const float minValue = -maxValue; const float range = (maxValue - minValue) / 255.0; const vec2 recipRange = vec2(1.0/range); const vec2 recipRange255 = vec2(1.0/(maxValue - minValue)); void setOutput(float decodedValue) { float a = dot(vec2(decodedValue, -minValue), recipRange); float b = fract(a) * 255.0; float c = fract(b) * 255.0; float d = fract(c) * 255.0; gl_FragColor = floor(vec4(a, b, c, d)) / 255.0; } `; } const fragmentShaderSource = ` precision highp float; uniform sampler2D source; varying vec2 resultUV; const vec2 inputShapeCR = vec2(${inputShapeRC[1]}.0, ${inputShapeRC[0]}.0); const vec2 halfCR = vec2(0.5, 0.5); ${setOutputSnippet} void main() { vec2 outputCR = floor(gl_FragCoord.xy); vec2 sourceCR = vec2(floor(outputCR[0] / 3.0), outputCR[1]); vec2 sourceUV = (sourceCR + halfCR) / inputShapeCR; vec4 sourceValue = texture2D(source, sourceUV) * 255.0; float channelValue = 0.0; int channel = int(mod(outputCR[0], 3.0)); if (channel == 0) { channelValue = sourceValue.r - 103.939; } else if (channel == 1) { channelValue = sourceValue.g - 116.779; } else if (channel == 2) { channelValue = sourceValue.b - 123.68; } setOutput(channelValue); }`; return gpgpu.createProgram(fragmentShaderSource); }
Unpacks an RGB packed image texture into a 2D physical, 3D logical texture with the conventional ndarray format and performs the standard imagenet image preprocessing.
getUnpackAndPreprocessInputShader ( gpgpu , inputShapeRC , useFloatTextures )
javascript
googlecreativelab/teachable-machine-v1
src/ai/imagenet_util.js
https://github.com/googlecreativelab/teachable-machine-v1/blob/master/src/ai/imagenet_util.js
Apache-2.0
function foo(a, b) { return hohoho(); }
This is a function @return {[Number]} @param {Number} a @param {String} b
foo ( a , b )
javascript
ternjs/tern
test/cases/jsdoc.js
https://github.com/ternjs/tern/blob/master/test/cases/jsdoc.js
MIT
var bar = function(a, b) { return goop(); };
This is also a function @returns {string} @arg {Number} a
bar ( a , b )
javascript
ternjs/tern
test/cases/jsdoc.js
https://github.com/ternjs/tern/blob/master/test/cases/jsdoc.js
MIT
function functionBogus(a) { return hohoho(); }
@return {bogus.Retval} @param {bogus.Arg} a
functionBogus ( a )
javascript
ternjs/tern
test/cases/jsdoc.js
https://github.com/ternjs/tern/blob/master/test/cases/jsdoc.js
MIT
function unionFunction(a) { return argh(); }
@param {string|null} a @return {Array.<Foo|number>}
unionFunction ( a )
javascript
ternjs/tern
test/cases/jsdoc.js
https://github.com/ternjs/tern/blob/master/test/cases/jsdoc.js
MIT
function sayHello(somebody) { somebody; //: string }
@param {?string} [somebody=John Doe] - Somebody's name.
sayHello ( somebody )
javascript
ternjs/tern
test/cases/jsdoc.js
https://github.com/ternjs/tern/blob/master/test/cases/jsdoc.js
MIT
function paramProperties(employee) { employee; //:: {department: string, name: string} }
Testing jsdoc with properties for an object @param {!Object} employee - The employee who is responsible for the project. @param {string} employee.name - The name of the employee. @param {string} employee.department - The employee's department.
paramProperties ( employee )
javascript
ternjs/tern
test/cases/jsdoc.js
https://github.com/ternjs/tern/blob/master/test/cases/jsdoc.js
MIT
function arrayParamProperties(employees) { employees; //:: [{department: string, name: string}] }
Testing jsdoc with properties for objects in an array @param {Object[]} employees - The employees who are responsible for the project. @param {string} employees[].name - The name of an employee. @param {string} employees[].department - The employee's department.
arrayParamProperties ( employees )
javascript
ternjs/tern
test/cases/jsdoc.js
https://github.com/ternjs/tern/blob/master/test/cases/jsdoc.js
MIT
manifestHandler?: (manifest: string) => string;
Handler to process manifest data. The handler is passed the manifest, and returns the modified manifest.
manifestHandler?
javascript
flow-typed/flow-typed
definitions/browser/chromecast-caf-receiver_v3.x.x/flow_v0.25.x-v0.103.x/chromecast-caf-receiver_v3.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/browser/chromecast-caf-receiver_v3.x.x/flow_v0.25.x-v0.103.x/chromecast-caf-receiver_v3.x.x.js
MIT
onChange?: (evt: SyntheticEvent<HTMLTextAreaElement>) => mixed, ...
React specific: An Event handler function. Required for controlled text areas. Fires immediately when the input’s value is changed by the user (for example, it fires on every keystroke). Behaves like the browser input event.
onChange?
javascript
flow-typed/flow-typed
definitions/environments/jsx/flow_v0.83.x-flow_v0.260.x/jsx.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/environments/jsx/flow_v0.83.x-flow_v0.260.x/jsx.js
MIT
sort(compareFn?: (a: T, b: T) => number): Array<T>;
Sorts an array. @param compareFn Function used to determine the order of the elements. It is expected to return a negative value if first argument is less than second argument, zero if they're equal and a positive value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. ```ts [11,2,22,1].sort((a, b) => a - b) ```
(anonymous)
javascript
flow-typed/flow-typed
definitions/environments/es5-1/flow_v0.104.x-v0.142.x/es5-1.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/environments/es5-1/flow_v0.104.x-v0.142.x/es5-1.js
MIT
static parse(text: string, reviver?: (key: string, value: mixed) => any): any;
Converts a JavaScript Object Notation (JSON) string into an object. @param text A valid JSON string. @param reviver A function that transforms the results. This function is called for each member of the object. If a member contains nested objects, the nested objects are transformed before the parent object is.
parse
javascript
flow-typed/flow-typed
definitions/environments/es5-1/flow_v0.104.x-v0.142.x/es5-1.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/environments/es5-1/flow_v0.104.x-v0.142.x/es5-1.js
MIT
declare function rm(path: PathLike, callback?: (err: ?ErrnoError) => void): void;
Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the completion callback. @since v14.14.0
rm
javascript
flow-typed/flow-typed
definitions/environments/node/flow_v0.261.x-/node.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/environments/node/flow_v0.261.x-/node.js
MIT
clearScreenDown(callback?: () => void): boolean;
Clears this WriteStream from the current cursor down.
clearScreenDown
javascript
flow-typed/flow-typed
definitions/environments/node/flow_v0.261.x-/node.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/environments/node/flow_v0.261.x-/node.js
MIT
databases?: () => Promise<Array<IDBDatabaseInfo>>;
Firefox introduced this method in its May 2024 release, having lagged behind other major browsers for several years. As of June 2024, previous versions of Firefox still account for 1.65% of global usage. For more details, see https://caniuse.com/mdn-api_idbfactory_databases
databases?
javascript
flow-typed/flow-typed
definitions/environments/indexeddb/flow_v0.261.x-/indexeddb.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/environments/indexeddb/flow_v0.261.x-/indexeddb.js
MIT
action(fn: (...args: Array<any>) => mixed): this;
Register callback `fn` for the command. Examples: program .command('help') .description('display verbose help') .action(function(){ // output help here }); @param {Function} fn @return {Command} for chaining @api public
action
javascript
flow-typed/flow-typed
definitions/npm/commander_v2.x.x/flow_v0.28.x-v0.103.x/commander_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/commander_v2.x.x/flow_v0.28.x-v0.103.x/commander_v2.x.x.js
MIT
option(flags: string, description?: string, fn?: ((val: any, memo: any) => mixed) | RegExp, defaultValue?: mixed): this;
Define option with `flags`, `description` and optional coercion `fn`. The `flags` string should contain both the short and long flags, separated by comma, a pipe or space. The following are all valid all will output this way when `--help` is used. "-p, --pepper" "-p|--pepper" "-p --pepper" Examples: // simple boolean defaulting to false program.option('-p, --pepper', 'add pepper'); --pepper program.pepper // => Boolean // simple boolean defaulting to true program.option('-C, --no-cheese', 'remove cheese'); program.cheese // => true --no-cheese program.cheese // => false // required argument program.option('-C, --chdir <path>', 'change the working directory'); --chdir /tmp program.chdir // => "/tmp" // optional argument program.option('-c, --cheese [type]', 'add cheese [marble]'); @param {String} flags @param {String} description @param {Function|Mixed} fn or default @param {Mixed} defaultValue @return {Command} for chaining @api public
option
javascript
flow-typed/flow-typed
definitions/npm/commander_v2.x.x/flow_v0.28.x-v0.103.x/commander_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/commander_v2.x.x/flow_v0.28.x-v0.103.x/commander_v2.x.x.js
MIT
outputHelp(cb?: ?(defaultHelp: string) => string): void;
Output help information for this command @api public
(anonymous)
javascript
flow-typed/flow-typed
definitions/npm/commander_v2.x.x/flow_v0.28.x-v0.103.x/commander_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/commander_v2.x.x/flow_v0.28.x-v0.103.x/commander_v2.x.x.js
MIT
result?: () => boolean, state?: () => boolean,
Only required if custom action. Returns a Boolean that is false if the command is unsupported or disabled.
result?
javascript
flow-typed/flow-typed
definitions/npm/pell_v1.x.x/flow_v0.69.x-v0.103.x/pell_v1.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/pell_v1.x.x/flow_v0.69.x-v0.103.x/pell_v1.x.x.js
MIT
onChange: (html: string) => void, /** * default = 'div' * Instructs the editor which element to inject via the return key */ defaultParagraphSeparator?: string,
Use the output html, triggered by element's `oninput` event
onChange
javascript
flow-typed/flow-typed
definitions/npm/pell_v1.x.x/flow_v0.69.x-v0.103.x/pell_v1.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/pell_v1.x.x/flow_v0.69.x-v0.103.x/pell_v1.x.x.js
MIT
declare type Exec = (command: string, value?: string) => void;
Execute a document command, see reference: https://developer.mozilla.org/en/docs/Web/API/Document/execCommand this is just `document.execCommand(command, false, value)`
=
javascript
flow-typed/flow-typed
definitions/npm/pell_v1.x.x/flow_v0.69.x-v0.103.x/pell_v1.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/pell_v1.x.x/flow_v0.69.x-v0.103.x/pell_v1.x.x.js
MIT
reportTitle?: string | (() => string),
Content of the HTML title element; or a function of the form () => string that provides the content. @default function that returns pretty printed current date and time.
|
javascript
flow-typed/flow-typed
definitions/npm/webpack-bundle-analyzer_v4.x.x/flow_v0.104.x-/webpack-bundle-analyzer_v4.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/webpack-bundle-analyzer_v4.x.x/flow_v0.104.x-/webpack-bundle-analyzer_v4.x.x.js
MIT
rgb: (round?: boolean) => [number, number, number];
Returns an array with the red, green, and blue component, each as number within the range 0..255. Chroma internally stores RGB channels as floats but rounds the numbers before returning them. You can pass false to prevent the rounding. @example chroma('orange').rgb() === [255,165,0] chroma('orange').darken().rgb() === [198,118,0] chroma('orange').darken().rgb(false) === [198.05,118.11,0]
rgb
javascript
flow-typed/flow-typed
definitions/npm/chroma-js_v2.x.x/flow_v0.104.x-/chroma-js_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/chroma-js_v2.x.x/flow_v0.104.x-/chroma-js_v2.x.x.js
MIT
rgba: (round?: boolean) => [number, number, number, number];
Just like color.rgb but adds the alpha channel to the returned array. @example chroma('orange').rgba() === [255,165,0,1] chroma('hsla(20, 100%, 40%, 0.5)').rgba() === [204,68,0,0.5]
rgba
javascript
flow-typed/flow-typed
definitions/npm/chroma-js_v2.x.x/flow_v0.104.x-/chroma-js_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/chroma-js_v2.x.x/flow_v0.104.x-/chroma-js_v2.x.x.js
MIT
hsl: () => [number, number, number];
Returns an array with the `hue`, `saturation`, and `lightness` component. Hue is the color angle in degree (`0..360`), saturation and lightness are within `0..1`. Note that for hue-less colors (black, white, and grays), the hue component will be NaN. @example chroma('orange').hsl() === [38.82,1,0.5,1] chroma('white').hsl() === [NaN,0,1,1]
hsl
javascript
flow-typed/flow-typed
definitions/npm/chroma-js_v2.x.x/flow_v0.104.x-/chroma-js_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/chroma-js_v2.x.x/flow_v0.104.x-/chroma-js_v2.x.x.js
MIT
hsv: () => [number, number, number];
Returns an array with the `hue`, `saturation`, and `value` components. Hue is the color angle in degree (`0..360`), saturation and value are within `0..1`. Note that for hue-less colors (black, white, and grays), the hue component will be NaN. @example chroma('orange').hsv() === [38.82,1,1] chroma('white').hsv() === [NaN,0,1]
hsv
javascript
flow-typed/flow-typed
definitions/npm/chroma-js_v2.x.x/flow_v0.104.x-/chroma-js_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/chroma-js_v2.x.x/flow_v0.104.x-/chroma-js_v2.x.x.js
MIT
hsi: () => [number, number, number];
Returns an array with the `hue`, `saturation`, and `intensity` components, each as number between 0 and 255. Note that for hue-less colors (black, white, and grays), the hue component will be NaN. @example chroma('orange').hsi() === [39.64,1,0.55] chroma('white').hsi() === [NaN,0,1]
hsi
javascript
flow-typed/flow-typed
definitions/npm/chroma-js_v2.x.x/flow_v0.104.x-/chroma-js_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/chroma-js_v2.x.x/flow_v0.104.x-/chroma-js_v2.x.x.js
MIT
lab: () => [number, number, number];
Returns an array with the **L**, **a**, and **b** components. @example chroma('orange').lab() === [74.94,23.93,78.95]
lab
javascript
flow-typed/flow-typed
definitions/npm/chroma-js_v2.x.x/flow_v0.104.x-/chroma-js_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/chroma-js_v2.x.x/flow_v0.104.x-/chroma-js_v2.x.x.js
MIT
lch: () => [number, number, number];
Returns an array with the **Lightness**, **chroma**, and **hue** components. @example chroma('skyblue').lch() === [79.21,25.94,235.11]
lch
javascript
flow-typed/flow-typed
definitions/npm/chroma-js_v2.x.x/flow_v0.104.x-/chroma-js_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/chroma-js_v2.x.x/flow_v0.104.x-/chroma-js_v2.x.x.js
MIT
hcl: () => [number, number, number];
Alias of [lch](#color-lch), but with the components in reverse order. @example chroma('skyblue').hcl() === [235.11,25.94,79.21]
hcl
javascript
flow-typed/flow-typed
definitions/npm/chroma-js_v2.x.x/flow_v0.104.x-/chroma-js_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/chroma-js_v2.x.x/flow_v0.104.x-/chroma-js_v2.x.x.js
MIT
getStateForAction: (action: NavigationAction, lastState: ?State) => ?State, /** * Maps a URI-like string to an action. This can be mapped to a state * using `getStateForAction`. */ getActionForPathAndParams: (
The reducer that outputs the new navigation state for a given action, with an optional previous state. When the action is considered handled but the state is unchanged, the output state is null.
getStateForAction
javascript
flow-typed/flow-typed
definitions/npm/react-navigation_v3.x.x/flow_v0.60.x-v0.91.x/react-navigation_v3.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/react-navigation_v3.x.x/flow_v0.60.x-v0.91.x/react-navigation_v3.x.x.js
MIT
transitionConfig?: () => TransitionConfig, } & NavigationNavigatorProps<NavigationStackScreenOptions, NavigationState>;
Optional custom animation when transitioning between screens.
transitionConfig?
javascript
flow-typed/flow-typed
definitions/npm/react-navigation_v3.x.x/flow_v0.60.x-v0.91.x/react-navigation_v3.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/react-navigation_v3.x.x/flow_v0.60.x-v0.91.x/react-navigation_v3.x.x.js
MIT
render?: (props: FormikProps<Values>) => React$Node, /** * A Yup Schema or a function that returns a Yup schema */ validationSchema?: any | (() => any),
Render prop (works like React router's <Route render={props =>} />)
render?
javascript
flow-typed/flow-typed
definitions/npm/formik_v0.11.x/flow_v0.59.x-v0.103.x/formik_v0.11.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/formik_v0.11.x/flow_v0.59.x-v0.103.x/formik_v0.11.x.js
MIT
validationSchema?: any | (() => any),
A Yup Schema or a function that returns a Yup schema
|
javascript
flow-typed/flow-typed
definitions/npm/formik_v0.11.x/flow_v0.59.x-v0.103.x/formik_v0.11.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/formik_v0.11.x/flow_v0.59.x-v0.103.x/formik_v0.11.x.js
MIT
validate?: (values: Values) => void | FormikErrors<Values> | Promise<any>, /** * React children or child render callback */ children?: ((props: FormikProps<Values>) => React$Node) | React$Node
Validation function. Must return an error object or promise that throws an error object where that object keys map to corresponding value.
(anonymous)
javascript
flow-typed/flow-typed
definitions/npm/formik_v0.11.x/flow_v0.59.x-v0.103.x/formik_v0.11.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/formik_v0.11.x/flow_v0.59.x-v0.103.x/formik_v0.11.x.js
MIT
onLoad?: () => any, /** * Fill the entire svg element with same color */ fillAll?: boolean
Invoked when load completes successfully when source.uri is remote address 'http://'
onLoad?
javascript
flow-typed/flow-typed
definitions/npm/react-native-svg-uri_v1.x.x/flow_v0.69.0-v0.103.x/react-native-svg-uri_v1.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/react-native-svg-uri_v1.x.x/flow_v0.69.0-v0.103.x/react-native-svg-uri_v1.x.x.js
MIT
declare export type ASTKindToNode = $ObjMapi<{ [k: ASTNode]: any }, <NodeT>(NodeT) => NodeT>;
Utility type listing all nodes indexed by their kind.
>
javascript
flow-typed/flow-typed
definitions/npm/graphql_v16.x.x/flow_v0.142.x-/graphql_v16.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/graphql_v16.x.x/flow_v0.142.x-/graphql_v16.x.x.js
MIT
declare export type ThunkReadonlyArray<T> = (() => $ReadOnlyArray<T>) | $ReadOnlyArray<T>;
Used while defining GraphQL types to allow for circular references in otherwise immutable type definitions.
=
javascript
flow-typed/flow-typed
definitions/npm/graphql_v16.x.x/flow_v0.142.x-/graphql_v16.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/graphql_v16.x.x/flow_v0.142.x-/graphql_v16.x.x.js
MIT
declare export type ASTVisitorKeyMap = $ObjMapi<{ [k: ASTNode]: any }, <NodeT>(NodeT) => $ReadOnlyArray<$Keys<NodeT>>>;
A KeyMap describes each the traversable properties of each kind of node. @deprecated Please inline it. Will be removed in v17
ASTVisitorKeyMap
javascript
flow-typed/flow-typed
definitions/npm/graphql_v16.x.x/flow_v0.142.x-/graphql_v16.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/graphql_v16.x.x/flow_v0.142.x-/graphql_v16.x.x.js
MIT
__ensureTypesOfVariablesAndResultMatching?: (variables: TRequestVariables) => TResponseData |} & DocumentNode;
This type is used to ensure that the variables you pass in to the query are assignable to Variables and that the Result is assignable to whatever you pass your result to. The method is never actually implemented, but the type is valid because we list it as optional
__ensureTypesOfVariablesAndResultMatching?
javascript
flow-typed/flow-typed
definitions/npm/graphql_v16.x.x/flow_v0.142.x-/graphql_v16.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/graphql_v16.x.x/flow_v0.142.x-/graphql_v16.x.x.js
MIT
reporter?: (errors: { [key: string]: Error }, env: any) => void;
Pass in a function to override the default error handling and console output. See lib/reporter.js for the default implementation.
reporter?
javascript
flow-typed/flow-typed
definitions/npm/envalid_v4.x.x/flow_v0.56.x-v0.103.x/envalid_v4.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/envalid_v4.x.x/flow_v0.56.x-v0.103.x/envalid_v4.x.x.js
MIT
transformer?: (env: any) => any;
A function used to transform the cleaned environment object before it is returned from cleanEnv.
transformer?
javascript
flow-typed/flow-typed
definitions/npm/envalid_v4.x.x/flow_v0.56.x-v0.103.x/envalid_v4.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/envalid_v4.x.x/flow_v0.56.x-v0.103.x/envalid_v4.x.x.js
MIT
setError: (e: any) => void, /** Manually set errors object */ setErrors: (errors: FormikErrors) => void,
Manually set top level error @deprecated since 0.8.0
setError
javascript
flow-typed/flow-typed
definitions/npm/formik_v0.9.x/flow_v0.201.x-/formik_v0.9.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/formik_v0.9.x/flow_v0.201.x-/formik_v0.9.x.js
MIT
declare var isErrorWithCause: (error: mixed) => boolean;
Checks if the given `error` is of type {@linkcode ErrorWithCause} @param {unknown} error Any unknown object to validate @returns `true` if the given `error` is of type {@linkcode ErrorWithCause}
isErrorWithCause
javascript
flow-typed/flow-typed
definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
MIT
declare var tryParseNativeCameraError: <T>(nativeError: T) => CameraCaptureError | CameraRuntimeError | T;
Tries to parse an error coming from native to a typed JS camera error. @param {CameraError} nativeError The native error instance. This is a JSON in the legacy native module architecture. @returns A {@linkcode CameraRuntimeError} or {@linkcode CameraCaptureError}, or the `nativeError` itself if it's not parsable @method
>
javascript
flow-typed/flow-typed
definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
MIT
onError?: (error: CameraRuntimeError) => void, /** * Called when the camera was successfully initialized. */ onInitialized?: () => void,
Called when any kind of runtime error occured.
onError?
javascript
flow-typed/flow-typed
definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
MIT
onInitialized?: () => void, /** * Called when a new performance suggestion for a Frame Processor is available - either if your Frame Processor is running too fast and frames are being dropped, or because it is able to run faster. Optionally, you can adjust your `frameProcessorFps` accordingly. */ onFrameProcessorPerformanceSuggestionAvailable?: (suggestion: FrameProcessorPerformanceSuggestion) => void,
Called when the camera was successfully initialized.
onInitialized?
javascript
flow-typed/flow-typed
definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
MIT
onFrameProcessorPerformanceSuggestionAvailable?: (suggestion: FrameProcessorPerformanceSuggestion) => void, /** * A worklet which will be called for every frame the Camera "sees". Throttle the Frame Processor's frame rate with {@linkcode frameProcessorFps}. * * > See [the Frame Processors documentation](https://mrousavy.github.io/react-native-vision-camera/docs/guides/frame-processors) for more information * * Note: If you want to use `video` and `frameProcessor` simultaneously, make sure [`supportsParallelVideoProcessing`](https://mrousavy.github.io/react-native-vision-camera/docs/guides/devices#the-supportsparallelvideoprocessing-prop) is `true`. * * @example ```tsx * const frameProcessor = useFrameProcessor((frame) => { * 'worklet' * const qrCodes = scanQRCodes(frame) * console.log(`Detected QR Codes: ${qrCodes}`) * }, []) * * return <Camera {...cameraProps} frameProcessor={frameProcessor} /> * ``` */ frameProcessor?: (frame: Frame) => void,
Called when a new performance suggestion for a Frame Processor is available - either if your Frame Processor is running too fast and frames are being dropped, or because it is able to run faster. Optionally, you can adjust your `frameProcessorFps` accordingly.
onFrameProcessorPerformanceSuggestionAvailable?
javascript
flow-typed/flow-typed
definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
MIT
frameProcessor?: (frame: Frame) => void, /** * Specifies the maximum frame rate the frame processor can use, independent of the Camera's frame rate (`fps` property). * * * A value of `'auto'` (default) indicates that the frame processor should execute as fast as it can, without dropping frames. This is achieved by collecting historical data for previous frame processor calls and adjusting frame rate accordingly. * * A value of `1` indicates that the frame processor gets executed once per second, perfect for code scanning. * * A value of `10` indicates that the frame processor gets executed 10 times per second, perfect for more realtime use-cases. * * A value of `25` indicates that the frame processor gets executed 25 times per second, perfect for high-speed realtime use-cases. * * ...and so on * * If you're using higher values, always check your Xcode/Android Studio Logs to make sure your frame processors are executing fast enough * without blocking the video recording queue. * @default 'auto' */ frameProcessorFps?: number | "auto",
A worklet which will be called for every frame the Camera "sees". Throttle the Frame Processor's frame rate with {@linkcode frameProcessorFps}. > See [the Frame Processors documentation](https://mrousavy.github.io/react-native-vision-camera/docs/guides/frame-processors) for more information Note: If you want to use `video` and `frameProcessor` simultaneously, make sure [`supportsParallelVideoProcessing`](https://mrousavy.github.io/react-native-vision-camera/docs/guides/devices#the-supportsparallelvideoprocessing-prop) is `true`. @example ```tsx const frameProcessor = useFrameProcessor((frame) => { 'worklet' const qrCodes = scanQRCodes(frame) console.log(`Detected QR Codes: ${qrCodes}`) }, []) return <Camera {...cameraProps} frameProcessor={frameProcessor} /> ```
frameProcessor?
javascript
flow-typed/flow-typed
definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
MIT
onRecordingError: (error: CameraCaptureError) => void;
Called when there was an unexpected runtime error while recording the video.
onRecordingError
javascript
flow-typed/flow-typed
definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
MIT
onRecordingFinished: (video: VideoFile) => void;
Called when the recording has been successfully saved to file.
onRecordingFinished
javascript
flow-typed/flow-typed
definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
MIT
declare var sortDevices: (left: CameraDevice, right: CameraDevice) => number;
Compares two devices by the following criteria: * `wide-angle-camera`s are ranked higher than others * Devices with more physical cameras are ranked higher than ones with less. (e.g. "Triple Camera" > "Wide-Angle Camera") > Note that this makes the `sort()` function descending, so the first element (`[0]`) is the "best" device. @example ```ts const devices = camera.devices.sort(sortDevices) const bestDevice = devices[0] ``` @method
sortDevices
javascript
flow-typed/flow-typed
definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
MIT
declare var sortFormats: (left: CameraDeviceFormat, right: CameraDeviceFormat) => number;
Sort formats by resolution and aspect ratio difference (to the Screen size). > Note that this makes the `sort()` function descending, so the first element (`[0]`) is the "best" device.
sortFormats
javascript
flow-typed/flow-typed
definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
MIT
declare var frameRateIncluded: (range: FrameRateRange, fps: number) => boolean;
Returns `true` if the given Frame Rate Range (`range`) contains the given frame rate (`fps`) @param {FrameRateRange} range The range to check if the given `fps` are included in @param {number} fps The FPS to check if the given `range` supports. @example ```ts // get all formats that support 60 FPS const formatsWithHighFps = useMemo(() => device.formats.filter((f) => f.frameRateRanges.some((r) => frameRateIncluded(r, 60))), [device.formats]) ``` @method
frameRateIncluded
javascript
flow-typed/flow-typed
definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/react-native-vision-camera_v2.x.x/flow_v0.142.x-/react-native-vision-camera_v2.x.x.js
MIT
declare type CallBack = (err: ?Error, matches: Array<string>) => void;
Called when an error occurs, or matches are found err matches: filenames found matching the pattern
CallBack
javascript
flow-typed/flow-typed
definitions/npm/glob_v7.x.x/flow_v0.42.x-v0.103.x/glob_v7.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/glob_v7.x.x/flow_v0.42.x-v0.103.x/glob_v7.x.x.js
MIT
put(packet: Packet, cb?: () => mixed): this;
Adds a packet to the store, a packet is anything that has a messageId property.
put
javascript
flow-typed/flow-typed
definitions/npm/mqtt_v4.2.x/flow_v0.84.x-/mqtt_v4.2.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/mqtt_v4.2.x/flow_v0.84.x-/mqtt_v4.2.x.js
MIT
cbStorePut?: () => mixed, |};
callback called when message is put into `outgoingStore`
cbStorePut?
javascript
flow-typed/flow-typed
definitions/npm/mqtt_v4.2.x/flow_v0.84.x-/mqtt_v4.2.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/mqtt_v4.2.x/flow_v0.84.x-/mqtt_v4.2.x.js
MIT
handleMessage: (packet: Packet, callback: PacketCallback) => void;
Handle messages with backpressure support, one at a time. Override at will. @param packet packet the packet @param callback callback call when finished @api public
handleMessage
javascript
flow-typed/flow-typed
definitions/npm/mqtt_v4.2.x/flow_v0.84.x-/mqtt_v4.2.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/mqtt_v4.2.x/flow_v0.84.x-/mqtt_v4.2.x.js
MIT
actionSanitizer?: <A: Action<any>>(action: A, id: number) => A, /** * function which takes `state` object and index as arguments, and should return `state` object back. */ stateSanitizer?: <S>(state: S, index: number) => S,
function which takes `action` object and id number as arguments, and should return `action` object back.
>
javascript
flow-typed/flow-typed
definitions/npm/@reduxjs/toolkit_v1.x.x/flow_v0.104.x-v0.133.x/toolkit_v1.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/@reduxjs/toolkit_v1.x.x/flow_v0.104.x-v0.133.x/toolkit_v1.x.x.js
MIT
stateSanitizer?: <S>(state: S, index: number) => S, /** * *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers). * If `actionsWhitelist` specified, `actionsBlacklist` is ignored. */ actionsBlacklist?: string | string[],
function which takes `state` object and index as arguments, and should return `state` object back.
>
javascript
flow-typed/flow-typed
definitions/npm/@reduxjs/toolkit_v1.x.x/flow_v0.104.x-v0.133.x/toolkit_v1.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/@reduxjs/toolkit_v1.x.x/flow_v0.104.x-v0.133.x/toolkit_v1.x.x.js
MIT
predicate?: <S, A: Action<any>>(state: S, action: A) => boolean, /** * if specified as `false`, it will not record the changes till clicking on `Start recording` button. * Available only for Redux enhancer, for others use `autoPause`. * * @default true */ shouldRecordChanges?: boolean,
called for every action before sending, takes `state` and `action` object, and returns `true` in case it allows sending the current data to the monitor. Use it as a more advanced version of `actionsBlacklist`/`actionsWhitelist` parameters.
>
javascript
flow-typed/flow-typed
definitions/npm/@reduxjs/toolkit_v1.x.x/flow_v0.104.x-v0.133.x/toolkit_v1.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/@reduxjs/toolkit_v1.x.x/flow_v0.104.x-v0.133.x/toolkit_v1.x.x.js
MIT
trace?: boolean | (<A: Action<any>>(action: A) => string),
Set to true or a stacktrace-returning function to record call stack traces for dispatched actions. Defaults to false.
|
javascript
flow-typed/flow-typed
definitions/npm/@reduxjs/toolkit_v1.x.x/flow_v0.104.x-v0.133.x/toolkit_v1.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/@reduxjs/toolkit_v1.x.x/flow_v0.104.x-v0.133.x/toolkit_v1.x.x.js
MIT
addCase<ActionCreator = TypedActionCreator<string>>(actionCreator: ActionCreator, reducer: (State, ReturnType<ActionCreator>) => void): ActionReducerMapBuilder<State>;
Add a case reducer for actions created by this action creator. @param actionCreator @param reducer
>
javascript
flow-typed/flow-typed
definitions/npm/@reduxjs/toolkit_v1.x.x/flow_v0.104.x-v0.133.x/toolkit_v1.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/@reduxjs/toolkit_v1.x.x/flow_v0.104.x-v0.133.x/toolkit_v1.x.x.js
MIT
declare type CaseReducers<S, AS = Actions<string>, K = any, V = any> = $ObjMapi<AS, (K, V) => {| [key: K]: CaseReducer<S, V> |}>;
A mapping from action types to case reducers for `createReducer()`. @deprecated This should not be used manually - it is only used for internal inference purposes and using it manually would lead to type erasure. It might be removed in the future. @public
>
javascript
flow-typed/flow-typed
definitions/npm/@reduxjs/toolkit_v1.x.x/flow_v0.104.x-v0.133.x/toolkit_v1.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/@reduxjs/toolkit_v1.x.x/flow_v0.104.x-v0.133.x/toolkit_v1.x.x.js
MIT
declare function createReducer<S, CR = {| [string]: (S, Action<string>) => S |}, A = any>(
A utility function that allows defining a reducer as a mapping from action type to *case reducer* functions that handle these action types. The reducer's initial state is passed as the first argument. The body of every case reducer is implicitly wrapped with a call to `produce()` from the [immer](https://github.com/mweststrate/immer) library. This means that rather than returning a new state object, you can also mutate the passed-in state object directly; these mutations will then be automatically and efficiently translated into copies, giving you both convenience and immutability. @param initialState The initial state to be returned by the reducer. @param actionsMap A mapping from action types to action-type-specific case reducers. @public
:
javascript
flow-typed/flow-typed
definitions/npm/@reduxjs/toolkit_v1.x.x/flow_v0.104.x-v0.133.x/toolkit_v1.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/@reduxjs/toolkit_v1.x.x/flow_v0.104.x-v0.133.x/toolkit_v1.x.x.js
MIT
declare type ConfigureEnhancersCallback = <S, A>(defaultEnhancers: $ReadOnlyArray<StoreEnhancer<S, A>>) => Array<StoreEnhancer<S, A>>;
Callback function type, to be used in `ConfigureStoreOptions.enhancers`
ConfigureEnhancersCallback
javascript
flow-typed/flow-typed
definitions/npm/@reduxjs/toolkit_v1.x.x/flow_v0.104.x-v0.133.x/toolkit_v1.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/@reduxjs/toolkit_v1.x.x/flow_v0.104.x-v0.133.x/toolkit_v1.x.x.js
MIT
middleware?: M | ((gDM: () => M) => M),
An array of Redux middleware to install. If not supplied, defaults to the set of middleware returned by `getDefaultMiddleware()`. @example `middleware: (gDM) => gDM().concat(logger, apiMiddleware, yourCustomMiddleware)` @see https://redux-toolkit.js.org/api/getDefaultMiddleware#intended-usage
|
javascript
flow-typed/flow-typed
definitions/npm/@reduxjs/toolkit_v1.x.x/flow_v0.104.x-v0.133.x/toolkit_v1.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/@reduxjs/toolkit_v1.x.x/flow_v0.104.x-v0.133.x/toolkit_v1.x.x.js
MIT
remove(predicate: (doc: T, idx: number) => boolean): T[];
Removes all documents from the list which the predicate returns truthy for, and returns an array of the removed docs. The predicate is invoked with two arguments: (doc, index).
remove
javascript
flow-typed/flow-typed
definitions/npm/fuse.js_v6.x.x/flow_v0.106.x-/fuse.js_v6.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/fuse.js_v6.x.x/flow_v0.106.x-/fuse.js_v6.x.x.js
MIT
function square(n) { return n * n; }
_.map examples from the official doc
square ( n )
javascript
flow-typed/flow-typed
definitions/npm/lodash_v4.x.x/flow_v0.63.x-v0.103.x/test_lodash-v4.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/lodash_v4.x.x/flow_v0.63.x-v0.103.x/test_lodash-v4.x.x.js
MIT
retryStrategy?: (times: number) => number | false, reconnectOnError?: (error: Error) => boolean,
When the return value isn't a number, ioredis will stop trying to reconnect. Fixed in: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/15858
retryStrategy?
javascript
flow-typed/flow-typed
definitions/npm/ioredis_v4.x.x/flow_v0.46.x-v0.103.x/ioredis_v4.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/ioredis_v4.x.x/flow_v0.46.x-v0.103.x/ioredis_v4.x.x.js
MIT
logTestingPlaygroundURL: (element?: Element | Document) => void, ...
Convenience function for `Testing Playground` which logs URL that can be opened in a browser
logTestingPlaygroundURL
javascript
flow-typed/flow-typed
definitions/npm/@testing-library/react_v11.x.x/flow_v0.201.x-/react_v11.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/@testing-library/react_v11.x.x/flow_v0.201.x-/react_v11.x.x.js
MIT
declare export function act(callback: () => void | Promise<void>): Thenable;
To prepare a component for assertions, wrap the code rendering it and performing updates inside an act() call. This makes your test run closer to how React works in the browser.
act
javascript
flow-typed/flow-typed
definitions/npm/@testing-library/react-hooks_v3.x.x/flow_v0.104.x-/react-hooks_v3.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/@testing-library/react-hooks_v3.x.x/flow_v0.104.x-/react-hooks_v3.x.x.js
MIT
+unmount: () => void, /** * Triggers a re-render. The props will be passed to your renderHook callback. */ +rerender: (newProps?: P) => void,
Unmounts the test component. This is useful for when you need to test any cleanup your useEffects have.
unmount
javascript
flow-typed/flow-typed
definitions/npm/@testing-library/react_v14.x.x/flow_v0.198.x-/react_v14.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/@testing-library/react_v14.x.x/flow_v0.198.x-/react_v14.x.x.js
MIT
+rerender: (newProps?: P) => void, |};
Triggers a re-render. The props will be passed to your renderHook callback.
rerender
javascript
flow-typed/flow-typed
definitions/npm/@testing-library/react_v14.x.x/flow_v0.198.x-/react_v14.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/@testing-library/react_v14.x.x/flow_v0.198.x-/react_v14.x.x.js
MIT
filter?: (input: AnyObject, prop: string | symbol) => boolean, /** * When set, will inline values up to inlineCharacterLimit length for the * sake of more terse output. */ transform?: (
Expected to return a boolean of whether to include the property property of the object object in the output.
filter?
javascript
flow-typed/flow-typed
definitions/npm/stringify-object_v4.x.x/flow_v0.104.x-/stringify-object_v4.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/stringify-object_v4.x.x/flow_v0.104.x-/stringify-object_v4.x.x.js
MIT
addChildCommand(name: string, fn: (...args: Array<any>) => any): void,
@see https://docs.cypress.io/api/cypress-api/custom-commands.html
addChildCommand
javascript
flow-typed/flow-typed
definitions/npm/cypress_v5.x.x/flow_v0.25.x-/cypress_v5.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/cypress_v5.x.x/flow_v0.25.x-/cypress_v5.x.x.js
MIT
_: { [key: string]: () => any, ... },
@see https://docs.cypress.io/api/utilities/_.html
]
javascript
flow-typed/flow-typed
definitions/npm/cypress_v5.x.x/flow_v0.25.x-/cypress_v5.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/cypress_v5.x.x/flow_v0.25.x-/cypress_v5.x.x.js
MIT
Blob: () => any, /** * @see https://docs.cypress.io/api/utilities/minimatch.html */ minimatch: () => any,
@see https://docs.cypress.io/api/utilities/blob.html
(anonymous)
javascript
flow-typed/flow-typed
definitions/npm/cypress_v5.x.x/flow_v0.25.x-/cypress_v5.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/cypress_v5.x.x/flow_v0.25.x-/cypress_v5.x.x.js
MIT
minimatch: () => any, /** * @see https://docs.cypress.io/api/utilities/moment.html */ moment: () => any,
@see https://docs.cypress.io/api/utilities/minimatch.html
(anonymous)
javascript
flow-typed/flow-typed
definitions/npm/cypress_v5.x.x/flow_v0.25.x-/cypress_v5.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/cypress_v5.x.x/flow_v0.25.x-/cypress_v5.x.x.js
MIT
moment: () => any, /** * @see https://docs.cypress.io/api/utilities/promise.html */ Promise: ((resolve: (...args: Array<any>) => any, reject: (...args: Array<any>) => any) => void) => Promise<any>,
@see https://docs.cypress.io/api/utilities/moment.html
(anonymous)
javascript
flow-typed/flow-typed
definitions/npm/cypress_v5.x.x/flow_v0.25.x-/cypress_v5.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/cypress_v5.x.x/flow_v0.25.x-/cypress_v5.x.x.js
MIT
Promise: ((resolve: (...args: Array<any>) => any, reject: (...args: Array<any>) => any) => void) => Promise<any>, /** * @see https://docs.cypress.io/api/utilities/sinon.html */ sinon: { [key: string]: any, ... },
@see https://docs.cypress.io/api/utilities/promise.html
(anonymous)
javascript
flow-typed/flow-typed
definitions/npm/cypress_v5.x.x/flow_v0.25.x-/cypress_v5.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/cypress_v5.x.x/flow_v0.25.x-/cypress_v5.x.x.js
MIT
on: (name: string, exe: (err: { message: string, ... }, runnable: any) => boolean | void) => void, /** * * @see https://docs.cypress.io/api/cypress-api/cypress-server.html */ Server: {|
@see https://docs.cypress.io/api/events/catalog-of-events.html#Uncaught-Exceptions
(anonymous)
javascript
flow-typed/flow-typed
definitions/npm/cypress_v5.x.x/flow_v0.25.x-/cypress_v5.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/cypress_v5.x.x/flow_v0.25.x-/cypress_v5.x.x.js
MIT
declare type MakeComparator = <A, B>(A => B) => CurriedFunction2<A, A, number>
In the examples for ascend and descend, its result is plugged into sort. In order for this to function properly ascend and descend need to yield a function that can take two arguments. In our case we'll declare the result function as curried, which matches the ramda behavior.
(anonymous)
javascript
flow-typed/flow-typed
definitions/npm/ramda_v0.26.x/flow_v0.76.x-v0.103.x/ramda_v0.26.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/ramda_v0.26.x/flow_v0.76.x-v0.103.x/ramda_v0.26.x.js
MIT
declare type LensObj<F, A, O> = (A => O) => O;
Because it is difficult to treat objects as if they are Functors, let's just have a lens type that works with objects, since Ramda supports objects as Functors in this context.
(anonymous)
javascript
flow-typed/flow-typed
definitions/npm/ramda_v0.26.x/flow_v0.76.x-v0.103.x/ramda_v0.26.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/ramda_v0.26.x/flow_v0.76.x-v0.103.x/ramda_v0.26.x.js
MIT
it('works as an input to sort', () => { const byAge = ascend(prop('age')); const people = [ { name: 'Emma', age: 70 }, { name: 'Peter', age: 78 }, { name: 'Mikhail', age: 62 }, ]; const peopleByYoungestFirst = sort(byAge, people); })
In the examples for ascend, its result is plugged into sort. In order for this to function properly ascend needs to yield a function that can take two arguments.
(anonymous)
javascript
flow-typed/flow-typed
definitions/npm/ramda_v0.26.x/flow_v0.76.x-v0.103.x/test_ramda_v0.26.x_relation.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/ramda_v0.26.x/flow_v0.76.x-v0.103.x/test_ramda_v0.26.x_relation.js
MIT
it('works as an input to sort', () => { const byAge = descend(prop('age')); const people = [ { name: 'Emma', age: 70 }, { name: 'Peter', age: 78 }, { name: 'Mikhail', age: 62 }, ]; const peopleByYoungestFirst = sort(byAge, people); })
In the examples for descend, its result is plugged into sort. In order for this to function properly descend needs to yield a function that can take two arguments.
(anonymous)
javascript
flow-typed/flow-typed
definitions/npm/ramda_v0.26.x/flow_v0.76.x-v0.103.x/test_ramda_v0.26.x_relation.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/ramda_v0.26.x/flow_v0.76.x-v0.103.x/test_ramda_v0.26.x_relation.js
MIT
describe('view', () => { it('works with lens', () => { type Data = { a: string, b: number, c: boolean } const data = { a: 'foo', b: 4, c: true, } const l = lens(x => x.b, (v, d) => ({ a: d.a, b: v, c: d.c, })) const result: Data = set(l, 3, data) }) it('works with lensIndex', () => { type Data = { a: string } const xs: Array<number> = [1, 2, 3] const result: number = view(lensIndex(0), xs) }) it('works with lensProp', () => { type Data = { a: string } const data = { a: 'foo' } const result: string = view(lensProp('a'), data) }) it('fails when the lensProp refers to a non-existent field', () => { type Data = { a: string } const data = { a: 'foo' } // $FlowExpectedError const result: string = view(lensProp('b'), data) }) it('produces the correct result type', () => { type Data = { a: string } const data = { a: 'foo' } // $FlowExpectedError const result: number = view(lensProp('a'), data) }) }) });
Normally we don't want to mix our tests with multiple functions (dependent tests can be difficult to reason about). Ramda's view works specifically with the various lens types, however. lensPath is not covered as cooperating with view because lensPath may not be expressible in Flow.
(anonymous)
javascript
flow-typed/flow-typed
definitions/npm/ramda_v0.26.x/flow_v0.76.x-v0.103.x/test_ramda_v0.26.x_object.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/ramda_v0.26.x/flow_v0.76.x-v0.103.x/test_ramda_v0.26.x_object.js
MIT
on(event: 'error', (error: Error) => mixed): this;
Emitted when an error occurs on the underlying server.
(anonymous)
javascript
flow-typed/flow-typed
definitions/npm/ws_v7.x.x/flow_v0.104.x-/ws_v7.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/ws_v7.x.x/flow_v0.104.x-/ws_v7.x.x.js
MIT
on(event: 'listening', () => mixed): this;
Emitted when the underlying server has been bound.
(anonymous)
javascript
flow-typed/flow-typed
definitions/npm/ws_v7.x.x/flow_v0.104.x-/ws_v7.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/ws_v7.x.x/flow_v0.104.x-/ws_v7.x.x.js
MIT
@@asyncIterator: () => AsyncGenerator<Item, void, mixed>;
Allow auto-paginating iteration on an unawaited list call, eg: for await (const item of client.items.list()) { console.log(item) }
(anonymous)
javascript
flow-typed/flow-typed
definitions/npm/openai_v4.x.x/flow_v0.142.x-/openai_v4.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/openai_v4.x.x/flow_v0.142.x-/openai_v4.x.x.js
MIT
beforeSend?: (jqXHR: JQueryXHR, settings: JQueryAjaxSettings) => any;
A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest: any) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request.
beforeSend?
javascript
flow-typed/flow-typed
definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
MIT
complete?: (jqXHR: JQueryXHR, textStatus: string) => any;
A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest: any) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event.
complete?
javascript
flow-typed/flow-typed
definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
MIT
dataFilter?: (data: any, ty: any) => any;
A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter.
dataFilter?
javascript
flow-typed/flow-typed
definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
MIT
error?: (jqXHR: JQueryXHR, textStatus?: string, errorThrown?: string) => any;
A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest: any) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event.
error?
javascript
flow-typed/flow-typed
definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
MIT
success?: (data: any, textStatus?: string, jqXHR?: JQueryXHR) => any;
A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest: any) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event.
success?
javascript
flow-typed/flow-typed
definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
MIT
catch(failFilter: (...reasons: any[]) => any): JQueryPromise<T>;
Add handlers to be called when the Deferred object is rejected. @param failFilter An function that is called when the Deferred is rejected.
(anonymous)
javascript
flow-typed/flow-typed
definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
MIT
step?: (now: number, tween: any) => any;
A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set.
step?
javascript
flow-typed/flow-typed
definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
MIT
start?: (animation: JQueryPromise<any>) => any;
A function to call when the animation begins. (version added: 1.8)
start?
javascript
flow-typed/flow-typed
definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
MIT
done?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8)
done?
javascript
flow-typed/flow-typed
definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
MIT
fail?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8)
fail?
javascript
flow-typed/flow-typed
definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/jquery_v3.x.x/flow_v0.28.x-v0.103.x/jquery_v3.x.x.js
MIT