{"_id":"@types/simple-swizzle","_rev":"2804104","name":"@types/simple-swizzle","description":"TypeScript definitions for simple-swizzle","dist-tags":{"latest":"0.2.0","ts4.1":"0.2.0","ts4.2":"0.2.0","ts4.3":"0.2.0","ts4.4":"0.2.0","ts4.5":"0.2.0","ts4.6":"0.2.0","ts4.7":"0.2.0","ts4.8":"0.2.0","ts4.9":"0.2.0"},"maintainers":[{"name":"types","email":""}],"time":{"modified":"2022-09-01T09:22:38.000Z","created":"2021-12-01T01:01:37.258Z","0.2.0":"2021-12-01T01:01:37.258Z"},"users":{},"repository":{"type":"git","url":"https://github.com/DefinitelyTyped/DefinitelyTyped.git","directory":"types/simple-swizzle"},"versions":{"0.2.0":{"name":"@types/simple-swizzle","version":"0.2.0","description":"TypeScript definitions for simple-swizzle","homepage":"https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/simple-swizzle","license":"MIT","contributors":[{"name":"BendingBender","url":"https://github.com/BendingBender","githubUsername":"BendingBender"}],"main":"","types":"index.d.ts","repository":{"type":"git","url":"https://github.com/DefinitelyTyped/DefinitelyTyped.git","directory":"types/simple-swizzle"},"scripts":{},"dependencies":{},"typesPublisherContentHash":"5877384414e515f98b062a359a2c7e1efb39fe906dd409bcd8576c7928585b04","typeScriptVersion":"4.1","_id":"@types/simple-swizzle@0.2.0","dist":{"shasum":"aa88313694fadc94daa92306c8a73865f4a978dc","size":2034,"noattachment":false,"key":"/@types/simple-swizzle/-/@types/simple-swizzle-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@types/simple-swizzle/download/@types/simple-swizzle-0.2.0.tgz"},"_npmUser":{"name":"types","email":"ts-npm-types@microsoft.com"},"directories":{},"maintainers":[{"name":"types","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/simple-swizzle_0.2.0_1638320497130_0.846289323111947"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-20T07:14:30.535Z","publish_time":1638320497258,"_cnpm_publish_time":1638320497258}},"readme":"# Installation\r\n> `npm install --save @types/simple-swizzle`\r\n\r\n# Summary\r\nThis package contains type definitions for simple-swizzle (https://github.com/qix-/node-simple-swizzle).\r\n\r\n# Details\r\nFiles were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/simple-swizzle.\r\n## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/simple-swizzle/index.d.ts)\r\n````ts\r\n// Type definitions for simple-swizzle 0.2\n// Project: https://github.com/qix-/node-simple-swizzle\n// Definitions by: BendingBender <https://github.com/BendingBender>\n// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped\n// Minimum TypeScript Version: 4.1\n\nexport = swizzle;\n\n/**\n * [Swizzle](https://en.wikipedia.org/wiki/Swizzling_(computer_graphics)) your function arguments.\n *\n * @example\n * import swizzle = require('simple-swizzle');\n *\n * function myFunc(...args: Array<number | number[]>): number[] {\n *     const argsArr = swizzle(args);\n *     // ...\n *     return argsArr;\n * }\n *\n * myFunc(1, [2, 3], 4); // [1, 2, 3, 4]\n * myFunc(1, 2, 3, 4);   // [1, 2, 3, 4]\n * myFunc([1, 2, 3, 4]); // [1, 2, 3, 4]\n */\ndeclare function swizzle<TElement extends unknown>(arguments: ArrayLike<TElement | ArrayLike<TElement>>): TElement[];\n\ndeclare namespace swizzle {\n    /**\n     * Functions can also be wrapped to automatically swizzle arguments and be passed the resulting array.\n     *\n     * @example\n     * import swizzle = require('simple-swizzle');\n     *\n     * const swizzledFn = swizzle.wrap((args: number[]): number[] {\n     *     // ...\n     *     return args;\n     * });\n     *\n     * swizzledFn(1, [2, 3], 4); // [1, 2, 3, 4]\n     * swizzledFn(1, 2, 3, 4);   // [1, 2, 3, 4]\n     * swizzledFn([1, 2, 3, 4]); // [1, 2, 3, 4]\n     */\n    function wrap<TFn extends (arguments: any[]) => unknown>(\n        fn: TFn,\n    ): (\n        ...args: Parameters<TFn>[0] extends Array<infer TElement> ? Array<TElement | TElement[]> : never\n    ) => ReturnType<TFn>;\n}\n\r\n````\r\n\r\n### Additional Details\r\n * Last updated: Wed, 01 Dec 2021 01:01:13 GMT\r\n * Dependencies: none\r\n * Global values: none\r\n\r\n# Credits\r\nThese definitions were written by [BendingBender](https://github.com/BendingBender).\r\n","_attachments":{},"homepage":"https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/simple-swizzle","license":"MIT"}