diff --git a/src/math.ts b/src/math.ts index 605c84c..e9ba7e9 100644 --- a/src/math.ts +++ b/src/math.ts @@ -73,11 +73,7 @@ export const bezierCurve = ( const max = 200 const vec = direction(start, finish) const length = magnitude(vec) - const spread = clamp(length, min, max) - const anchors = generateBezierAnchors( - start, - finish, - overrideSpread ?? spread - ) + const spread = overrideSpread ?? clamp(length, min, max) + const anchors = generateBezierAnchors(start, finish, spread) return new Bezier(start, ...anchors, finish) } diff --git a/src/spoof.ts b/src/spoof.ts index d783cf3..d8389ea 100644 --- a/src/spoof.ts +++ b/src/spoof.ts @@ -56,7 +56,7 @@ export interface ClickOptions extends MoveOptions { */ readonly waitForClick?: number /** - * Delay after performing the click in milliseconds. + * @extends moveDelay * @default 2000 */ readonly moveDelay?: number @@ -76,7 +76,7 @@ export interface PathOptions { interface RandomMoveOptions extends Pick { /** - * Delay after performing the click in milliseconds. + * @extends moveDelay * @default 2000 */ readonly moveDelay?: number diff --git a/tsconfig.json b/tsconfig.json index 2782d45..5006392 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,23 +2,23 @@ "compilerOptions": { /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ - "target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, - "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, + "target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, + "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, "skipLibCheck": true, "lib": ["es2015", "dom"], - "outDir": "./lib" /* Redirect output structure to the directory. */, - "rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, + "outDir": "./lib" /* Redirect output structure to the directory. */, + "rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, "declaration": true, // "composite": true, /* Enable project compilation */ // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ - "removeComments": true /* Do not emit comments to output. */, + "removeComments": false /* Keep comments-- want JSDocs in types */, // "noEmit": true, /* Do not emit outputs. */ // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - "downlevelIteration": true /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */, + "downlevelIteration": true /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */, // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ /* Strict Type-Checking Options */ - "strict": true /* Enable all strict type-checking options. */, - "noImplicitAny": false /* Raise error on expressions and declarations with an implied 'any' type. */, + "strict": true /* Enable all strict type-checking options. */, + "noImplicitAny": false /* Raise error on expressions and declarations with an implied 'any' type. */, // "strictNullChecks": true, /* Enable strict null checks. */ // "strictFunctionTypes": true, /* Enable strict checking of function types. */ // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ @@ -38,7 +38,7 @@ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ /* Source Map Options */ @@ -50,7 +50,7 @@ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ /* Advanced Options */ - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ + "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ }, "include": ["src/**/*"], "exclude": ["node_modules"],