diff --git a/package-lock.json b/package-lock.json index e921256..01e2286 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "native-file-system-adapter", - "version": "1.0.1", + "version": "2.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "1.0.1", + "version": "2.0.1", "funding": [ { "type": "github", @@ -23,12 +23,12 @@ }, "devDependencies": { "@types/filesystem": "^0.0.30", - "airtap-manual": "^1.0.0", "rollup": "^2.51.1", "rollup-plugin-multi-input": "^1.3.1", "rollup-plugin-terser": "^7.0.2", "standard": "^16.0.3", - "tape": "^5.2.2" + "tape": "^5.2.2", + "typescript": "^4.4.4" }, "optionalDependencies": { "web-streams-polyfill": "^3.1.1" @@ -147,20 +147,6 @@ "integrity": "sha512-zjQ69G564OCIWIOHSXyQEEDpdpGl+G348RAKY0XXy9Z5kU9Vzv1GMNnkar/ZJ8dzXB3COzD9Mo9NtRZ4xfgUww==", "dev": true }, - "node_modules/abstract-browser": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/abstract-browser/-/abstract-browser-1.0.0.tgz", - "integrity": "sha512-CJC6Wzow4cSFLsKhZJj0EGi3+023xmoRpW1FeNF9ErPwixkJTSO70Op/i6L120I6W36xm9GrXm4yquLNAywrEw==", - "dev": true, - "dependencies": { - "browser-manifest": "^1.0.0", - "catering": "^2.0.0", - "nanoresource": "^1.3.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/acorn": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", @@ -182,35 +168,6 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/airtap-manual": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/airtap-manual/-/airtap-manual-1.0.0.tgz", - "integrity": "sha512-xQ2qSkQNn/vvztw9ApMN3OMVbdJIBrom40+JkgL3lgL/S29OrNQ1Hl6qASiVenCvqtUEg6pYu+vsBxcVCZj86Q==", - "dev": true, - "dependencies": { - "abstract-browser": "^1.0.0", - "browser-provider": "^1.1.0" - }, - "engines": { - "node": ">=10.2" - } - }, - "node_modules/airtap-match-browsers": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/airtap-match-browsers/-/airtap-match-browsers-1.1.1.tgz", - "integrity": "sha512-bscZpmugpAo2v0Gg2NmlP9kFbHnQKTqYKFOWXYcdc2eo2k6MLVxaE2K08BLeO+wp3ctOt0reK/5y6BOLWWXfMg==", - "dev": true, - "dependencies": { - "browser-names": "^1.0.1", - "deep-dot": "0.0.2", - "deep-equal": "^2.0.1", - "is-fork-pr": "^2.5.0", - "merge-deep": "^3.0.2" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -266,15 +223,6 @@ "sprintf-js": "~1.0.2" } }, - "node_modules/arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/array-includes": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz", @@ -378,38 +326,6 @@ "node": ">=8" } }, - "node_modules/browser-manifest": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browser-manifest/-/browser-manifest-1.0.0.tgz", - "integrity": "sha512-+XZt3+6aTlqzI7OWYz4IPx8a2Ogxnl65AA5rTQvPYdB6YO1SLDQLqWJ4TR2QoAwyb29w78vU6trpqX5+9RoXXg==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/browser-names": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/browser-names/-/browser-names-1.1.0.tgz", - "integrity": "sha512-ytPHDpg38klSYRfsrvpU9IglWptXoLHWLrXGUuF3p+HqnowPciDAVcmldvey8B+EjP0eC2Mvwnk6sZxRt9PhMQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/browser-provider": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browser-provider/-/browser-provider-1.2.0.tgz", - "integrity": "sha512-8ixthQVQxgDyVt3tMzbbaonsjq+eDDS9opxCE+b7EzaqbgD9LVMunmijCm3/rmKFC7JLeHY0d2o0hsH98G1tKw==", - "dev": true, - "dependencies": { - "airtap-match-browsers": "^1.0.0", - "browser-manifest": "^1.0.0", - "catering": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -438,15 +354,6 @@ "node": ">=6" } }, - "node_modules/catering": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/catering/-/catering-2.0.0.tgz", - "integrity": "sha512-aD/WmxhGwUGsVPrj8C80vH7C7GphJilYVSdudoV4u16XdrLF7CVyfBmENsc4tLTVsJJzCRid8GbwJ7mcPLee6Q==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -461,22 +368,6 @@ "node": ">=4" } }, - "node_modules/clone-deep": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-0.2.4.tgz", - "integrity": "sha1-TnPdCen7lxzDhnDF3O2cGJZIHMY=", - "dev": true, - "dependencies": { - "for-own": "^0.1.3", - "is-plain-object": "^2.0.1", - "kind-of": "^3.0.2", - "lazy-cache": "^1.0.3", - "shallow-clone": "^0.1.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -555,12 +446,6 @@ } } }, - "node_modules/deep-dot": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/deep-dot/-/deep-dot-0.0.2.tgz", - "integrity": "sha1-10iMh3dEADLruca46Xc8QTW8P/o=", - "dev": true - }, "node_modules/deep-equal": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", @@ -1444,27 +1329,6 @@ "is-callable": "^1.1.3" } }, - "node_modules/for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "dependencies": { - "for-in": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/foreach": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", @@ -1739,12 +1603,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, "node_modules/is-callable": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", @@ -1781,15 +1639,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -1799,18 +1648,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-fork-pr": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/is-fork-pr/-/is-fork-pr-2.5.0.tgz", - "integrity": "sha512-kca2MhWNsJSUxN/Ud1CPPa+r+XpRnUXfheB8bvgjP6kCgCMYgIL5YMlwx0k7xnyqjnNaEzkQgS14S/SzhOPYkQ==", - "dev": true, - "bin": { - "is-fork-pr": "src/bin/is.js" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -1874,18 +1711,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-regex": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz", @@ -1987,15 +1812,6 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/jest-worker": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", @@ -2096,27 +1912,6 @@ "node": ">=4.0" } }, - "node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/lazy-cache": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -2188,20 +1983,6 @@ "node": ">=10" } }, - "node_modules/merge-deep": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/merge-deep/-/merge-deep-3.0.3.tgz", - "integrity": "sha512-qtmzAS6t6grwEkNrunqTBdn0qKwFgNWvlxUbAV8es9M7Ot1EbyApytCnvE0jALPa46ZpKDUo527kKiaWplmlFA==", - "dev": true, - "dependencies": { - "arr-union": "^3.1.0", - "clone-deep": "^0.2.4", - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -2248,28 +2029,6 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, - "node_modules/mixin-object": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/mixin-object/-/mixin-object-2.0.1.tgz", - "integrity": "sha1-T7lJRB2rGCVA8f4DW6YOGUel5X4=", - "dev": true, - "dependencies": { - "for-in": "^0.1.3", - "is-extendable": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/mixin-object/node_modules/for-in": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.8.tgz", - "integrity": "sha1-2Hc5COMSVhCZUrH9ubP6hn0ndeE=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", @@ -2288,15 +2047,6 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/nanoresource": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/nanoresource/-/nanoresource-1.3.0.tgz", - "integrity": "sha512-OI5dswqipmlYfyL3k/YMm7mbERlh4Bd1KuKdMHpeoVD1iVxqxaTMKleB4qaA2mbQZ6/zMNSxCXv9M9P/YbqTuQ==", - "dev": true, - "dependencies": { - "inherits": "^2.0.4" - } - }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -3037,42 +2787,6 @@ "randombytes": "^2.1.0" } }, - "node_modules/shallow-clone": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-0.1.2.tgz", - "integrity": "sha1-WQnodLp3EG1zrEFM/sH/yofZcGA=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.1", - "kind-of": "^2.0.1", - "lazy-cache": "^0.2.3", - "mixin-object": "^2.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/shallow-clone/node_modules/kind-of": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-2.0.1.tgz", - "integrity": "sha1-AY7HpM5+OobLkUG+UZ0kyPqpgbU=", - "dev": true, - "dependencies": { - "is-buffer": "^1.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/shallow-clone/node_modules/lazy-cache": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-0.2.7.tgz", - "integrity": "sha1-f+3fLctu23fRHvHRF6tf/fCrG2U=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -3511,6 +3225,19 @@ "node": ">=8" } }, + "node_modules/typescript": { + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", + "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, "node_modules/unbox-primitive": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", @@ -3762,17 +3489,6 @@ "integrity": "sha512-zjQ69G564OCIWIOHSXyQEEDpdpGl+G348RAKY0XXy9Z5kU9Vzv1GMNnkar/ZJ8dzXB3COzD9Mo9NtRZ4xfgUww==", "dev": true }, - "abstract-browser": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/abstract-browser/-/abstract-browser-1.0.0.tgz", - "integrity": "sha512-CJC6Wzow4cSFLsKhZJj0EGi3+023xmoRpW1FeNF9ErPwixkJTSO70Op/i6L120I6W36xm9GrXm4yquLNAywrEw==", - "dev": true, - "requires": { - "browser-manifest": "^1.0.0", - "catering": "^2.0.0", - "nanoresource": "^1.3.0" - } - }, "acorn": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", @@ -3786,29 +3502,6 @@ "dev": true, "requires": {} }, - "airtap-manual": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/airtap-manual/-/airtap-manual-1.0.0.tgz", - "integrity": "sha512-xQ2qSkQNn/vvztw9ApMN3OMVbdJIBrom40+JkgL3lgL/S29OrNQ1Hl6qASiVenCvqtUEg6pYu+vsBxcVCZj86Q==", - "dev": true, - "requires": { - "abstract-browser": "^1.0.0", - "browser-provider": "^1.1.0" - } - }, - "airtap-match-browsers": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/airtap-match-browsers/-/airtap-match-browsers-1.1.1.tgz", - "integrity": "sha512-bscZpmugpAo2v0Gg2NmlP9kFbHnQKTqYKFOWXYcdc2eo2k6MLVxaE2K08BLeO+wp3ctOt0reK/5y6BOLWWXfMg==", - "dev": true, - "requires": { - "browser-names": "^1.0.1", - "deep-dot": "0.0.2", - "deep-equal": "^2.0.1", - "is-fork-pr": "^2.5.0", - "merge-deep": "^3.0.2" - } - }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -3851,12 +3544,6 @@ "sprintf-js": "~1.0.2" } }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, "array-includes": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz", @@ -3930,29 +3617,6 @@ "fill-range": "^7.0.1" } }, - "browser-manifest": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browser-manifest/-/browser-manifest-1.0.0.tgz", - "integrity": "sha512-+XZt3+6aTlqzI7OWYz4IPx8a2Ogxnl65AA5rTQvPYdB6YO1SLDQLqWJ4TR2QoAwyb29w78vU6trpqX5+9RoXXg==", - "dev": true - }, - "browser-names": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/browser-names/-/browser-names-1.1.0.tgz", - "integrity": "sha512-ytPHDpg38klSYRfsrvpU9IglWptXoLHWLrXGUuF3p+HqnowPciDAVcmldvey8B+EjP0eC2Mvwnk6sZxRt9PhMQ==", - "dev": true - }, - "browser-provider": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browser-provider/-/browser-provider-1.2.0.tgz", - "integrity": "sha512-8ixthQVQxgDyVt3tMzbbaonsjq+eDDS9opxCE+b7EzaqbgD9LVMunmijCm3/rmKFC7JLeHY0d2o0hsH98G1tKw==", - "dev": true, - "requires": { - "airtap-match-browsers": "^1.0.0", - "browser-manifest": "^1.0.0", - "catering": "^2.0.0" - } - }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -3975,12 +3639,6 @@ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, - "catering": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/catering/-/catering-2.0.0.tgz", - "integrity": "sha512-aD/WmxhGwUGsVPrj8C80vH7C7GphJilYVSdudoV4u16XdrLF7CVyfBmENsc4tLTVsJJzCRid8GbwJ7mcPLee6Q==", - "dev": true - }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -3992,19 +3650,6 @@ "supports-color": "^5.3.0" } }, - "clone-deep": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-0.2.4.tgz", - "integrity": "sha1-TnPdCen7lxzDhnDF3O2cGJZIHMY=", - "dev": true, - "requires": { - "for-own": "^0.1.3", - "is-plain-object": "^2.0.1", - "kind-of": "^3.0.2", - "lazy-cache": "^1.0.3", - "shallow-clone": "^0.1.2" - } - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -4064,12 +3709,6 @@ "ms": "2.1.2" } }, - "deep-dot": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/deep-dot/-/deep-dot-0.0.2.tgz", - "integrity": "sha1-10iMh3dEADLruca46Xc8QTW8P/o=", - "dev": true - }, "deep-equal": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", @@ -4742,21 +4381,6 @@ "is-callable": "^1.1.3" } }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "requires": { - "for-in": "^1.0.1" - } - }, "foreach": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", @@ -4955,12 +4579,6 @@ "call-bind": "^1.0.2" } }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, "is-callable": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", @@ -4982,24 +4600,12 @@ "integrity": "sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A==", "dev": true }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, - "is-fork-pr": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/is-fork-pr/-/is-fork-pr-2.5.0.tgz", - "integrity": "sha512-kca2MhWNsJSUxN/Ud1CPPa+r+XpRnUXfheB8bvgjP6kCgCMYgIL5YMlwx0k7xnyqjnNaEzkQgS14S/SzhOPYkQ==", - "dev": true - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -5039,15 +4645,6 @@ "integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==", "dev": true }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, "is-regex": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz", @@ -5116,12 +4713,6 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, "jest-worker": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", @@ -5203,21 +4794,6 @@ "object.assign": "^4.1.2" } }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, - "lazy-cache": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", - "dev": true - }, "levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -5274,17 +4850,6 @@ "yallist": "^4.0.0" } }, - "merge-deep": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/merge-deep/-/merge-deep-3.0.3.tgz", - "integrity": "sha512-qtmzAS6t6grwEkNrunqTBdn0qKwFgNWvlxUbAV8es9M7Ot1EbyApytCnvE0jALPa46ZpKDUo527kKiaWplmlFA==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "clone-deep": "^0.2.4", - "kind-of": "^3.0.2" - } - }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -5322,24 +4887,6 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, - "mixin-object": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/mixin-object/-/mixin-object-2.0.1.tgz", - "integrity": "sha1-T7lJRB2rGCVA8f4DW6YOGUel5X4=", - "dev": true, - "requires": { - "for-in": "^0.1.3", - "is-extendable": "^0.1.1" - }, - "dependencies": { - "for-in": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.8.tgz", - "integrity": "sha1-2Hc5COMSVhCZUrH9ubP6hn0ndeE=", - "dev": true - } - } - }, "mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", @@ -5355,15 +4902,6 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "nanoresource": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/nanoresource/-/nanoresource-1.3.0.tgz", - "integrity": "sha512-OI5dswqipmlYfyL3k/YMm7mbERlh4Bd1KuKdMHpeoVD1iVxqxaTMKleB4qaA2mbQZ6/zMNSxCXv9M9P/YbqTuQ==", - "dev": true, - "requires": { - "inherits": "^2.0.4" - } - }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -5880,35 +5418,6 @@ "randombytes": "^2.1.0" } }, - "shallow-clone": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-0.1.2.tgz", - "integrity": "sha1-WQnodLp3EG1zrEFM/sH/yofZcGA=", - "dev": true, - "requires": { - "is-extendable": "^0.1.1", - "kind-of": "^2.0.1", - "lazy-cache": "^0.2.3", - "mixin-object": "^2.0.1" - }, - "dependencies": { - "kind-of": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-2.0.1.tgz", - "integrity": "sha1-AY7HpM5+OobLkUG+UZ0kyPqpgbU=", - "dev": true, - "requires": { - "is-buffer": "^1.0.2" - } - }, - "lazy-cache": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-0.2.7.tgz", - "integrity": "sha1-f+3fLctu23fRHvHRF6tf/fCrG2U=", - "dev": true - } - } - }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -6236,6 +5745,12 @@ "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true }, + "typescript": { + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", + "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", + "dev": true + }, "unbox-primitive": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", diff --git a/package.json b/package.json index d7934bf..fb4d784 100644 --- a/package.json +++ b/package.json @@ -14,12 +14,17 @@ "test:node": "node test/test-node.js", "test:deno": "deno run --allow-read --allow-write --allow-net test/test-deno.js", "test:wpt-in-deno": "deno run --allow-read --allow-write --allow-net test/test-wpt-in-deno.js", - "build": "rm -rf dist && rollup -c rollup.config.js" + "build": "rm -rf dist && rollup -c rollup.config.js", + "prepublishOnly": "rm -rf types && tsc" }, "repository": { "type": "git", "url": "git+https://github.com/jimmywarting/native-file-system-adapter.git" }, + "engines": { + "node": ">=14.8.0" + }, + "types": "types", "keywords": [ "filesystem", "file", @@ -56,7 +61,8 @@ "rollup-plugin-multi-input": "^1.3.1", "rollup-plugin-terser": "^7.0.2", "standard": "^16.0.3", - "tape": "^5.2.2" + "tape": "^5.2.2", + "typescript": "^4.4.4" }, "standard": { "globals": [ diff --git a/tsconfig.json b/tsconfig.json index 80dfcbf..e71d188 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,5 +11,5 @@ "lib": ["es2019", "dom"], "outDir": "./types/" }, - "include": ["src/*.js"] + "include": ["mod.js"] } diff --git a/types/mod.d.ts b/types/mod.d.ts new file mode 100644 index 0000000..c3eddd7 --- /dev/null +++ b/types/mod.d.ts @@ -0,0 +1 @@ +export * from "./src/es6.js"; diff --git a/types/src/FileSystemDirectoryHandle.d.ts b/types/src/FileSystemDirectoryHandle.d.ts new file mode 100644 index 0000000..c515ebe --- /dev/null +++ b/types/src/FileSystemDirectoryHandle.d.ts @@ -0,0 +1,22 @@ +export default FileSystemDirectoryHandle; +export class FileSystemDirectoryHandle extends FileSystemHandle { + constructor(adapter: any); + getDirectoryHandle(name: string, options?: { + create?: boolean; + }): Promise; + entries(): AsyncGenerator<[string, FileSystemHandle | FileSystemDirectoryHandle]>; + getEntries(): AsyncGenerator; + getFileHandle(name: string, options?: { + create?: boolean; + }): Promise; + removeEntry(name: string, options?: { + recursive?: boolean; + }): Promise; + resolve(possibleDescendant: any): Promise; + keys(): AsyncGenerator; + values(): AsyncGenerator; + [kAdapter]: any; + [Symbol.asyncIterator](): AsyncGenerator<[string, FileSystemHandle | FileSystemDirectoryHandle], any, any>; +} +import FileSystemHandle from "./FileSystemHandle.js"; +declare const kAdapter: unique symbol; diff --git a/types/src/FileSystemFileHandle.d.ts b/types/src/FileSystemFileHandle.d.ts new file mode 100644 index 0000000..66a6a0d --- /dev/null +++ b/types/src/FileSystemFileHandle.d.ts @@ -0,0 +1,12 @@ +export default FileSystemFileHandle; +export class FileSystemFileHandle extends FileSystemHandle { + constructor(adapter: any); + createWritable(options?: { + keepExistingData?: boolean; + }): Promise; + getFile(): Promise; + [kAdapter]: any; +} +import FileSystemHandle from "./FileSystemHandle.js"; +import FileSystemWritableFileStream from "./FileSystemWritableFileStream.js"; +declare const kAdapter: unique symbol; diff --git a/types/src/FileSystemHandle.d.ts b/types/src/FileSystemHandle.d.ts new file mode 100644 index 0000000..52ccb0e --- /dev/null +++ b/types/src/FileSystemHandle.d.ts @@ -0,0 +1,20 @@ +export default FileSystemHandle; +export class FileSystemHandle { + constructor(adapter: FileSystemHandle & { + writable; + }); + name: string; + kind: ('file' | 'directory'); + queryPermission({ mode }?: { + mode?: string; + }): Promise; + requestPermission({ mode }?: { + mode?: string; + }): Promise; + remove(options?: { + recursive?: boolean; + }): Promise; + isSameEntry(other: FileSystemHandle): Promise; + [kAdapter]: any; +} +declare const kAdapter: unique symbol; diff --git a/types/src/FileSystemWritableFileStream.d.ts b/types/src/FileSystemWritableFileStream.d.ts new file mode 100644 index 0000000..33ba7d1 --- /dev/null +++ b/types/src/FileSystemWritableFileStream.d.ts @@ -0,0 +1,8 @@ +export default FileSystemWritableFileStream; +export class FileSystemWritableFileStream extends WritableStream { + constructor(...args: any[]); + private _closed; + seek(position: number): Promise; + truncate(size: number): Promise; + write(data: any): Promise; +} diff --git a/types/src/adapters/downloader.d.ts b/types/src/adapters/downloader.d.ts new file mode 100644 index 0000000..6180755 --- /dev/null +++ b/types/src/adapters/downloader.d.ts @@ -0,0 +1,8 @@ +export class FileHandle { + constructor(name?: string); + name: string; + kind: string; + getFile(): Promise; + isSameEntry(other: any): Promise; + createWritable(options?: object): Promise>; +} diff --git a/types/src/adapters/memory.d.ts b/types/src/adapters/memory.d.ts new file mode 100644 index 0000000..51e1385 --- /dev/null +++ b/types/src/adapters/memory.d.ts @@ -0,0 +1,46 @@ +export class Sink { + constructor(fileHandle: FileHandle, file: File); + fileHandle: FileHandle; + file: File; + size: number; + position: number; + write(chunk: any): void; + close(): void; +} +export class FileHandle { + constructor(name?: string, file?: File, writable?: boolean); + _file: File; + name: string; + kind: string; + _deleted: boolean; + writable: boolean; + readable: boolean; + getFile(): Promise; + createWritable(opts: any): Promise; + isSameEntry(other: any): Promise; + _destroy(): Promise; +} +export class FolderHandle { + constructor(name: string, writable?: boolean); + name: string; + kind: string; + _deleted: boolean; + _entries: { + [x: string]: (FolderHandle | FileHandle); + }; + writable: boolean; + readable: boolean; + entries(): AsyncGenerator<[string, FileHandle | FolderHandle]>; + isSameEntry(other: any): Promise; + getDirectoryHandle(name: string, opts: { + create: boolean; + }): Promise; + getFileHandle(name: string, opts: { + create: boolean; + }): Promise; + removeEntry(name: any, opts: any): Promise; + _destroy(recursive: any): Promise; +} +declare function _default(): FolderHandle; +export default _default; +declare const File_1: typeof window.File; diff --git a/types/src/adapters/sandbox.d.ts b/types/src/adapters/sandbox.d.ts new file mode 100644 index 0000000..dc766f8 --- /dev/null +++ b/types/src/adapters/sandbox.d.ts @@ -0,0 +1,39 @@ +export class FileHandle { + constructor(file: FileEntry, writable?: boolean); + file: FileEntry; + kind: string; + writable: boolean; + readable: boolean; + get name(): string; + isSameEntry(other: any): boolean; + getFile(): Promise; + createWritable(opts: any): Promise; +} +export class FolderHandle { + constructor(dir: DirectoryEntry, writable?: boolean); + dir: DirectoryEntry; + writable: boolean; + readable: boolean; + kind: string; + name: string; + isSameEntry(other: FolderHandle): boolean; + entries(): AsyncGenerator<[string, FileHandle | FolderHandle]>; + getDirectoryHandle(name: string, opts: { + create: boolean; + }): Promise; + getFileHandle(name: string, opts: { + create: boolean; + }): Promise; + removeEntry(name: string, opts: { + recursive: boolean; + }): Promise; +} +declare function _default(opts?: {}): Promise; +export default _default; +declare class Sink { + constructor(writer: FileWriter, fileEntry: FileEntry); + writer: FileWriter; + fileEntry: FileEntry; + write(chunk: BlobPart | any): Promise; + close(): Promise; +} diff --git a/types/src/es6.d.ts b/types/src/es6.d.ts new file mode 100644 index 0000000..8bc90d2 --- /dev/null +++ b/types/src/es6.d.ts @@ -0,0 +1,9 @@ +import FileSystemDirectoryHandle from "./FileSystemDirectoryHandle.js"; +import FileSystemFileHandle from "./FileSystemFileHandle.js"; +import FileSystemHandle from "./FileSystemHandle.js"; +import FileSystemWritableFileStream from "./FileSystemWritableFileStream.js"; +import getOriginPrivateDirectory from "./getOriginPrivateDirectory.js"; +import showDirectoryPicker from "./showDirectoryPicker.js"; +import showOpenFilePicker from "./showOpenFilePicker.js"; +import showSaveFilePicker from "./showSaveFilePicker.js"; +export { FileSystemDirectoryHandle, FileSystemFileHandle, FileSystemHandle, FileSystemWritableFileStream, getOriginPrivateDirectory, showDirectoryPicker, showOpenFilePicker, showSaveFilePicker }; diff --git a/types/src/getOriginPrivateDirectory.d.ts b/types/src/getOriginPrivateDirectory.d.ts new file mode 100644 index 0000000..7de8e57 --- /dev/null +++ b/types/src/getOriginPrivateDirectory.d.ts @@ -0,0 +1,3 @@ +export default getOriginPrivateDirectory; +export type FileSystemDirectoryHandle = import('./FileSystemDirectoryHandle.js').default; +declare function getOriginPrivateDirectory(driver?: object | undefined, options?: {}): Promise; diff --git a/types/src/showDirectoryPicker.d.ts b/types/src/showDirectoryPicker.d.ts new file mode 100644 index 0000000..da6e7ee --- /dev/null +++ b/types/src/showDirectoryPicker.d.ts @@ -0,0 +1,5 @@ +export default showDirectoryPicker; +export type FileSystemDirectoryHandle = import('./FileSystemDirectoryHandle.js').default; +export function showDirectoryPicker(options?: { + _preferPolyfill?: boolean; +}): Promise; diff --git a/types/src/showOpenFilePicker.d.ts b/types/src/showOpenFilePicker.d.ts new file mode 100644 index 0000000..84bdcc0 --- /dev/null +++ b/types/src/showOpenFilePicker.d.ts @@ -0,0 +1,8 @@ +export default showOpenFilePicker; +export type FileSystemFileHandle = import('./FileSystemFileHandle.js').default; +export function showOpenFilePicker(options?: { + multiple?: boolean; + excludeAcceptAllOption?: boolean; + accepts?: any[]; + _preferPolyfill?: boolean; +}): Promise; diff --git a/types/src/showSaveFilePicker.d.ts b/types/src/showSaveFilePicker.d.ts new file mode 100644 index 0000000..89b21c2 --- /dev/null +++ b/types/src/showSaveFilePicker.d.ts @@ -0,0 +1,9 @@ +export default showSaveFilePicker; +export type FileSystemFileHandle = import('./FileSystemFileHandle.js').default; +export function showSaveFilePicker(options?: { + excludeAcceptAllOption?: boolean; + accepts?: any[]; + suggestedName?: string; + _name?: string; + _preferPolyfill?: boolean; +}): Promise; diff --git a/types/src/util.d.ts b/types/src/util.d.ts new file mode 100644 index 0000000..3fbc587 --- /dev/null +++ b/types/src/util.d.ts @@ -0,0 +1,18 @@ +export function fromDataTransfer(entries: any): Promise; +export function getDirHandlesFromInput(input: any): Promise; +export function getFileHandlesFromInput(input: any): Promise; +export namespace errors { + const INVALID: string[]; + const GONE: string[]; + const MISMATCH: string[]; + const MOD_ERR: string[]; + function SYNTAX(m: any): string[]; + const SECURITY: string[]; + const DISALLOWED: string[]; +} +export namespace config { + const writable: { + new (underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream; + prototype: WritableStream; + }; +}