diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 819cbdc..30c9b89 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,15 +22,16 @@ jobs: - run: pnpm install - - run: pnpm exec tsx ./.vitepress/scripts/updateVersion.ts - - run: pnpm run docs:build-mirror + - run: pnpm -F @gkd-kit/docs exec tsx ./.vitepress/scripts/updateVersion.ts + + - run: pnpm -F @gkd-kit/api run predocs:dev + - run: pnpm -F @gkd-kit/docs run docs:build-mirror - name: Publish package run: | pnpm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }} - pnpm publish --no-git-checks + pnpm -F @gkd-kit/docs publish --no-git-checks - - run: git checkout . - run: curl -X PUT 'https://registry-direct.npmmirror.com/@gkd-kit/docs/sync' - uses: cloudflare/pages-action@v1 @@ -38,4 +39,4 @@ jobs: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} projectName: gkd-docs - directory: ./.vitepress/dist + directory: ./docs/.vitepress/dist diff --git a/.gitignore b/.gitignore index c27b79e..dcef7dd 100644 --- a/.gitignore +++ b/.gitignore @@ -18,5 +18,7 @@ node_modules *.sln *.sw? .eslintcache -.vitepress/dist -.vitepress/cache +docs/.vitepress/dist +docs/.vitepress/cache + +/docs/api diff --git a/README.md b/README.md index 5b60d95..a8aac46 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ -# @gkd-kit/docs +# 说明 -GKD 文档(尚未开发完毕), 基于 [vitepress](https://vitepress.dev/zh/) 构建, 可前往 [gkd.li](https://gkd.li/) 预览 +GKD 文档(尚未开发完毕), 基于 [vitepress](https://vitepress.dev/zh/) 构建 -- 使用 `pnpm i` 安装项目依赖 -- 使用 `pnpm docs:dev` 启动开发服务器 -- 实时修改 markdown 文件并预览站点 +可前往 [gkd.li](https://gkd.li/) 预览 diff --git a/api/package.json b/api/package.json new file mode 100644 index 0000000..3e54804 --- /dev/null +++ b/api/package.json @@ -0,0 +1,16 @@ +{ + "name": "@gkd-kit/api", + "version": "0.0.0", + "description": "a typescript kit for gkd", + "type": "module", + "main": "./src/index.ts", + "publishConfig": { + "registry": "https://registry.npmjs.org/" + }, + "scripts": { + "predocs:dev": "typedoc" + }, + "volta": { + "extends": "../package.json" + } +} diff --git a/api/pnpm-lock.yaml b/api/pnpm-lock.yaml new file mode 100644 index 0000000..c757334 --- /dev/null +++ b/api/pnpm-lock.yaml @@ -0,0 +1,386 @@ +lockfileVersion: '6.0' + +settings: + autoInstallPeers: false + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@types/node': + specifier: ^20.11.14 + version: 20.11.14 + prettier: + specifier: ^3.2.4 + version: 3.2.4 + tsx: + specifier: ^4.7.0 + version: 4.7.0 + typedoc: + specifier: ^0.25.7 + version: 0.25.7(typescript@5.3.3) + typescript: + specifier: ^5.3.3 + version: 5.3.3 + + examples: {} + + gkd-kit: {} + +packages: + + /@esbuild/aix-ppc64@0.19.12: + resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm64@0.19.12: + resolution: {integrity: sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm@0.19.12: + resolution: {integrity: sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-x64@0.19.12: + resolution: {integrity: sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64@0.19.12: + resolution: {integrity: sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64@0.19.12: + resolution: {integrity: sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-arm64@0.19.12: + resolution: {integrity: sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-x64@0.19.12: + resolution: {integrity: sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64@0.19.12: + resolution: {integrity: sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm@0.19.12: + resolution: {integrity: sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ia32@0.19.12: + resolution: {integrity: sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64@0.19.12: + resolution: {integrity: sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-mips64el@0.19.12: + resolution: {integrity: sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ppc64@0.19.12: + resolution: {integrity: sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-riscv64@0.19.12: + resolution: {integrity: sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-s390x@0.19.12: + resolution: {integrity: sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-x64@0.19.12: + resolution: {integrity: sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64@0.19.12: + resolution: {integrity: sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-x64@0.19.12: + resolution: {integrity: sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/sunos-x64@0.19.12: + resolution: {integrity: sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-arm64@0.19.12: + resolution: {integrity: sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32@0.19.12: + resolution: {integrity: sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-x64@0.19.12: + resolution: {integrity: sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@types/node@20.11.14: + resolution: {integrity: sha512-w3yWCcwULefjP9DmDDsgUskrMoOy5Z8MiwKHr1FvqGPtx7CvJzQvxD7eKpxNtklQxLruxSXWddyeRtyud0RcXQ==} + dependencies: + undici-types: 5.26.5 + dev: true + + /ansi-sequence-parser@1.1.1: + resolution: {integrity: sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==} + dev: true + + /balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: true + + /brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.2 + dev: true + + /esbuild@0.19.12: + resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/aix-ppc64': 0.19.12 + '@esbuild/android-arm': 0.19.12 + '@esbuild/android-arm64': 0.19.12 + '@esbuild/android-x64': 0.19.12 + '@esbuild/darwin-arm64': 0.19.12 + '@esbuild/darwin-x64': 0.19.12 + '@esbuild/freebsd-arm64': 0.19.12 + '@esbuild/freebsd-x64': 0.19.12 + '@esbuild/linux-arm': 0.19.12 + '@esbuild/linux-arm64': 0.19.12 + '@esbuild/linux-ia32': 0.19.12 + '@esbuild/linux-loong64': 0.19.12 + '@esbuild/linux-mips64el': 0.19.12 + '@esbuild/linux-ppc64': 0.19.12 + '@esbuild/linux-riscv64': 0.19.12 + '@esbuild/linux-s390x': 0.19.12 + '@esbuild/linux-x64': 0.19.12 + '@esbuild/netbsd-x64': 0.19.12 + '@esbuild/openbsd-x64': 0.19.12 + '@esbuild/sunos-x64': 0.19.12 + '@esbuild/win32-arm64': 0.19.12 + '@esbuild/win32-ia32': 0.19.12 + '@esbuild/win32-x64': 0.19.12 + dev: true + + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /get-tsconfig@4.7.2: + resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==} + dependencies: + resolve-pkg-maps: 1.0.0 + dev: true + + /jsonc-parser@3.2.1: + resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==} + dev: true + + /lunr@2.3.9: + resolution: {integrity: sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==} + dev: true + + /marked@4.3.0: + resolution: {integrity: sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==} + engines: {node: '>= 12'} + hasBin: true + dev: true + + /minimatch@9.0.3: + resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: true + + /prettier@3.2.4: + resolution: {integrity: sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==} + engines: {node: '>=14'} + hasBin: true + dev: true + + /resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + dev: true + + /shiki@0.14.7: + resolution: {integrity: sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==} + dependencies: + ansi-sequence-parser: 1.1.1 + jsonc-parser: 3.2.1 + vscode-oniguruma: 1.7.0 + vscode-textmate: 8.0.0 + dev: true + + /tsx@4.7.0: + resolution: {integrity: sha512-I+t79RYPlEYlHn9a+KzwrvEwhJg35h/1zHsLC2JXvhC2mdynMv6Zxzvhv5EMV6VF5qJlLlkSnMVvdZV3PSIGcg==} + engines: {node: '>=18.0.0'} + hasBin: true + dependencies: + esbuild: 0.19.12 + get-tsconfig: 4.7.2 + optionalDependencies: + fsevents: 2.3.3 + dev: true + + /typedoc@0.25.7(typescript@5.3.3): + resolution: {integrity: sha512-m6A6JjQRg39p2ZVRIN3NKXgrN8vzlHhOS+r9ymUYtcUP/TIQPvWSq7YgE5ZjASfv5Vd5BW5xrir6Gm2XNNcOow==} + engines: {node: '>= 16'} + hasBin: true + peerDependencies: + typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x + dependencies: + lunr: 2.3.9 + marked: 4.3.0 + minimatch: 9.0.3 + shiki: 0.14.7 + typescript: 5.3.3 + dev: true + + /typescript@5.3.3: + resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} + engines: {node: '>=14.17'} + hasBin: true + dev: true + + /undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + dev: true + + /vscode-oniguruma@1.7.0: + resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==} + dev: true + + /vscode-textmate@8.0.0: + resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} + dev: true diff --git a/api/src/index.ts b/api/src/index.ts new file mode 100644 index 0000000..e9a71e8 --- /dev/null +++ b/api/src/index.ts @@ -0,0 +1,504 @@ +/** + * 一个或者多个值类型 + */ +export type IArray = T | T[]; + +/** + * 全局规则(组)和应用规则(组)的基础通用属性 + */ +export type RawCommonProps = { + /** + * 单位: 毫秒 + * + * 当前规则的冷却时间, 或者执行 action 最小间隔 + * + * @default 1000 + */ + actionCd?: number; + + /** + * 单位: 毫秒 + * + * 延迟执行: 查询到节点->等待一段时间->再次查询到节点则执行对应 action + * + */ + actionDelay?: number; + + /** + * + * 如果开启, 此规则下的所有 `末尾属性选择器`的`第一个属性选择表达式`符合下面的结构之一的选择器 将使用快速查找 + * + * - [id='abc'] + * - [vid='abc'] + * - [text='abc'] + * - [text^='abc'] + * - [text*='abc'] + * - [text$='abc'] + * + * 比如 `A > B + C[id='x'][childCount=2]` 符合, 但 `A > B + C[childCount=2][id='x']` 不符合 + * + * 它的底层原理是 跳过手动遍历所有节点 直接调用 [findAccessibilityNodeInfosByViewId](https://developer.android.google.cn/reference/android/view/accessibility/AccessibilityNodeInfo#findAccessibilityNodeInfosByViewId(java.lang.String)) / [findAccessibilityNodeInfosByText](https://developer.android.google.cn/reference/android/view/accessibility/AccessibilityNodeInfo#findAccessibilityNodeInfosByText(java.lang.String)) 得到可匹配节点 + * + * 大多数情况下都能查询到, 在少数某些复杂结构下, 即使目标节点存在, 快速查询也不一定查询到 + * + * 比如 [Image < @View + View >2 [text*='广告']](https://github.com/gkd-kit/subscription/blob/1ae87452d287b558f58f9c4e4448a3190e212ca1/src/apps/com.zidongdianji.ts#L26) 虽然符合快速查询的条件但是使用 `findAccessibilityNodeInfosByText("广告")` 并不能查询到节点 + * + * 它是优点是快速, 因为遍历所有节点是一个耗时行为, 虽然多数情况下这种耗时较低 + * + * 但是在某些软件比如 哔哩哔哩 的开屏广告在这种耗时下延迟可达 1-2s, 这也是导致 [gkd-kit/gkd#60](https://github.com/gkd-kit/gkd/issues/60) 的原因 + * + * --- + * + * v1.4.1 版本后生成的快照时将标识每个节点是否可 quickFind, 网页审查工具属性面板顶部会注明这个标识, 同时节点树如果字体的标粗体也表示这个节点可 quickFind + * + * [![image](https://github.com/gkd-kit/subscription/assets/38517192/80cdbad1-fa8d-4415-81a1-cecaa7d69e33)](https://i.gkd.li/import/13316168) + * + */ + quickFind?: boolean; + + /** + * 单位: 毫秒 + * + * 匹配延迟 + * + * 规则准备匹配/或被唤醒时, 等待一段时间, 使此规则参与查询屏幕节点 + * + */ + matchDelay?: number; + + /** + * 单位: 毫秒 + * + * 规则匹配时间, 此规则参与查询屏幕节点时, 等待一段时间, 休眠此规则 + * + * 例如某些应用的 开屏广告 的 activityId 容易误触/太广泛, 而开屏广告几乎只在应用切出来时出现, 设置一个有限匹配时间能避免后续的误触 + * + */ + matchTime?: number; + + /** + * 最大执行次数 + * + * 规则的 action 被执行的最大次数, 达到最大次数时, 休眠此规则 + * + * 功能类似 matchTime, 适用于只需要执行一次的: 开屏广告/更新弹窗/青少年弹窗 一类规则 + * + * 当规则准备匹配/或被唤醒时, 将重新计算次数 + * + */ + actionMaximum?: number; + + /** + * 当规则因为 matchTime/actionMaximum 而休眠时, 如何唤醒此规则 + * + * @default 'activity' + * + * @example + * 'activity' + * // 当 activity 刷新时, 唤醒规则 + * // 刷新 activity 并不代表 activityId 变化 + * // 如 哔哩哔哩视频播放页 底部点击推荐视频 进入另一个 视频播放页, 进入了新 activity 但是 activityId 并没有变化 + * + * @example + * 'app' + * // 重新进入 app 时, 唤醒规则 + */ + resetMatch?: 'activity' | 'app'; + + /** + * 与这个 key 的 rule 共享 cd + * + * 比如开屏广告可能需要多个 rule 去匹配, 当一个 rule 触发时, 其它 rule 的触发是无意义的 + * + * 如果你对这个 key 的 rule 设置 actionCd=3000, 那么当这个 rule 和 本 rule 触发任意一个时, 在 3000毫秒 内两个 rule 都将进入 cd + */ + actionCdKey?: number; + + /** + * 与这个 key 的 rule 共享次数 + * + * 比如开屏广告可能需要多个 rule 去匹配, 当一个 rule 触发时, 其它 rule 的触发是无意义的 + * + * 如果你对这个 key 的 rule 设置 actionMaximum=1, 那么当这个 rule 和 本 rule 触发任意一个时, 两个 rule 都将进入休眠 + */ + actionMaximumKey?: number; + + /** + * 规则参与匹配的顺序, 数字越小越先匹配 + * + * 如果两个规则 order 相同, 按照 groups 中的数组顺序匹配, app 类型规则顺序优先于 global 类型规则 + * + * 属于不同订阅的规则按照订阅列表中顺序匹配, 长按订阅卡片可以拖动排序 + * + * @default 0 + * + */ + order?: number; + + /** + * 当前 规则/规则组 的快照链接, 增强订阅可维护性 + */ + snapshotUrls?: IArray; + + /** + * 当前 规则/规则组 的规则在手机上的运行示例, 支持 jpg/png/webp/gif + * + * 如果规则是多个规则组合起来的, 可以更好看懂规则到底在干啥, 比如 点击关闭按钮-选择关闭原因-确认关闭 这种广告用 gif 看着更清楚在干啥 + */ + exampleUrls?: IArray; +}; + +/** + * 全局规则和应用规则的基础通用属性 + */ +export type RawRuleProps = RawCommonProps & { + /** + * 当前规则在列表中的唯一标识 + * + * key 没有顺序大小之分, 可以是任意数字 + * + * 设置后不可更改, 否则造成点击记录错乱 + */ + key?: number; + + /** + * 规则名称 + */ + name?: string; + + /** + * 要求当前列表里某个 key 刚刚执行 + * + * 比如点击关闭按钮-选择关闭原因-确认关闭, key 分别是 1,2,3, preKeys 分别是 [],[1],[2] + * + * 那么 选择关闭原因 必须要求 比如点击关闭按钮 刚刚点击过才能执行, 确认关闭 也要求 选择关闭原因 刚刚点击过才执行 + * + * 否则后面的规则不会触发, 也就是要求规则按顺序执行, 这是为了防止规则匹配范围太过广泛而误触 + * + */ + preKeys?: IArray; + + /** + * @example + * `click` + * // 为默认值, 如果目标节点是 clickable 的, 则使用 `clickNode`, 反之使用 `clickCenter` + * // 并且当 `clickNode` 事件没有被应用接收时, 则使用 `clickCenter` + * + * @example + * `clickNode` + * // 向系统发起一个点击无障碍节点事件. 即使节点在屏幕外部/或者被其它节点遮挡,也依然能够正确触发点击目标节点 + * // 但是如果目标节点不是 clickable 的, 目标应用通常不响应这个点击事件, 也就是点击无效果 + * // 在极少数情况下, 即使节点是 clickable 的,应用显示接收但是不响应节点点击事件, 此时需要手动设置 `clickCenter` + * + * @example + * `clickCenter` + * // 计算出此控件的中心的坐标并且如果这个坐标在屏幕内部,那么就向系统发起一个点击屏幕坐标事件 + * // 如果这个坐标不在屏幕内部, 当作未匹配 + * // 另外如果目标节点的位置被其它节点遮挡覆盖, 则会点击触发最上层的节点(可能不是目标节点) + * + * @example + * `back` + * // 向系统发起一个返回事件, 相当于按下返回键 + * + * @example + * `longClick` + * // 如果目标节点是 longClickable 的, 则使用 `longClickNode`, 反之使用 `longClickCenter` + * // 并且当 `longClickNode` 事件没有被应用接收时, 则使用 `longClickCenter` + * + * @example + * `longClickNode` + * // 向系统发起一个长按无障碍节点事件,与 clickNode 类似 + * + * @example + * `longClickCenter` + * // 与 clickCenter 类似, 长按时间为 400 毫秒 + */ + action?: + | 'click' + | 'clickNode' + | 'clickCenter' + | 'back' + | 'longClick' + | 'longClickNode' + | 'longClickCenter'; + + /** + * 一个或者多个合法的 GKD 选择器, 如果每个选择器都能匹配上节点, 那么点击最后一个选择器的目标节点 + */ + matches?: IArray; + + /** + * 一个或者多个合法的 GKD 选择器, 如果存在一个选择器匹配上节点, 则停止匹配此规则 + */ + excludeMatches?: IArray; +}; + +/** + * 全局规则组和应用规则组的基础通用属性 + */ +export type RawGroupProps = RawCommonProps & { + /** + * 当前规则组在列表中的唯一标识 + * + * 也是客户端禁用/启用此规则组的依据 + * + * 设置后不可更改, 否则造成客户端启用/禁用错乱 + * + * key 没有顺序大小之分, 可以是任意数字 + */ + key: number; + + /** + * 规则组名称 + */ + name: string; + + /** + * 规则组描述 + */ + desc?: string; + + /** + * 控制规则默认情况下是启用还是禁用 + * + * @default true + */ + enable?: boolean; + + /** + * 其它 group 的 key, 允许将目标组的所有 rule 添加到当前组的作用域 + * + * 假设 group1{key=1} 有一个 rule1{key=11}, group2{key=2} 有 rule2{key=22}, rule3{key=23} + * + * 如果 group1 的 scopeKeys=[2] 并且 group2 没有被禁用, 那么 rule1 的 preKeys/actionCdKey/actionMaximumKey 可以是 11/22/23 + * + * 如果存在相同 key 的 rule, 优先使用本组的 rule, 其次按 scopeKeys 的顺序查找其它组的 rule + * + */ + scopeKeys?: IArray; + + // rules: RawRuleProps[]; +}; + +/** + * 应用规则(组)的基础通用属性 + */ +export type RawAppRuleProps = { + /** + * 如果 设备界面Id startWith activityIds 的任意一项, 则匹配 + * + * 如果要匹配所有界面: `undefined` (不填写) 或者 `[]` (避免使用上级属性) + */ + activityIds?: IArray; + + /** + * 如果 设备界面Id startWith excludeActivityIds 的任意一项, 则排除匹配 + * + * 优先级高于 activityIds + */ + excludeActivityIds?: IArray; +}; + +// <--全局规则相关-- +/** + * 全局规则应用配置 + */ +export type RawGlobalApp = RawAppRuleProps & { + /** + * 目标应用的包名 + */ + id: string; + + /** + * 在此应用启用/禁用此规则 + * + * @default true + */ + enable?: boolean; +}; + +/** + * 全局规则的基础通用属性 + */ +export type RawGlobalRuleProps = { + /** + * true => 匹配任意应用 + * + * false => 仅匹配 apps 里面的应用 + * + * @default true + */ + matchAnyApp?: boolean; + + /** + * 是否匹配桌面, 仅全局规则可用 + * + * 如果你切换了桌面, 你需要打开 GKD 的界面触发识别新桌面 + * + * @default false + */ + matchLauncher?: boolean; + + /** + * 是否匹配系统应用, 仅全局规则可用 + * + * @default false + */ + matchSystemApp?: boolean; + + /** + * 应用配置列表, 配置应用内界面如何匹配或不匹配 + */ + apps?: RawGlobalApp[]; +}; + +/** + * 全局规则 + */ +export type RawGlobalRule = RawRuleProps & RawGlobalRuleProps; + +/** + * 全局规则组 + */ +export type RawGlobalGroup = RawGroupProps & + RawGlobalRuleProps & { + rules: RawGlobalRule[]; + }; +// --全局规则相关--> + +// <--APP规则相关-- + +/** + * 应用规则分类 + */ +export type RawCategory = { + /** + * 当前分类在列表中的唯一标识 + * + * 也是客户端禁用/启用此分类组的依据 + */ + key: number; + + /** + * 分类名称 + * + * 同时也是分类的依据, 捕获以 name 开头的所有应用规则组, 不捕获全局规则组 + * + * 示例: `开屏广告` 将捕获 `开屏广告-1` `开屏广告-2` `开屏广告-233` 这类应用规则组 + */ + name: string; + + /** + * null => 跟随捕获的规则组的 enable 的默认值 + * + * true => 全部启用捕获的规则组 + * + * false => 全部禁用捕获的规则组 + */ + enable?: boolean; +}; + +/** + * 应用规则 + */ +export type RawAppRule = RawRuleProps & RawAppRuleProps; + +/** + * 应用规则组 + */ +export type RawAppGroup = RawGroupProps & + RawAppRuleProps & { + /** + * string => { matches: string } + * + * string[] => { matches: string }[] + */ + rules: IArray; + }; + +/** + * 应用规则应用配置 + */ +export type RawApp = { + /** + * 应用包名 + */ + id: string; + + /** + * 如果设备没有安装这个应用, 则使用这个名称显示 + */ + name?: string; + + /** + * 此应用的规则组列表 + */ + groups: RawAppGroup[]; +}; +// --APP规则相关--> + +/** + * 订阅配置类型 + */ +export type RawSubscription = { + /** + * 当前订阅文件的标识, 如果新旧订阅文件id不一致则更新失败\ + * 范围: `[0, Number.MAX_SAFE_INTEGER]`\ + * 建议值: `new Date().getTime()` + * + * GKD默认订阅是 0, 负数 id 内部使用, 不允许用户添加负数 id 的订阅 + * + * 负数订阅由应用内部使用, 如本地订阅是 -2, 内存订阅是 -1 + */ + id: number; + + /** + * 订阅的名称 + */ + name: string; + + /** + * 订阅的版本号, 用于检测更新 + * + * 只有当新订阅的 version 大于本地旧订阅的 version 才执行更新替换本地 + */ + version: number; + + author?: string; + + /** + * GKD 会定时或者用户手动刷新请求这个链接, 如果返回的订阅的 version 大于应用订阅当前的 version , 则更新 + * + * 如果这个字段不存在, 则使用添加订阅时填写的链接 + */ + updateUrl?: string; + + /** + * 一个自定义 uri 链接, 用户点击[用户反馈]时, 打开此链接 + * + * 可以是一个网页链接, 也可以是一个应用内部的 uri 链接 + */ + supportUri?: string; + + /** + * 一个只需要 id 和 version 的 json 文件链接, 检测更新时, 优先检测此链接, 如果 id 相等并且 version 增加, 则再去请求 updateUrl + * + * 目的是防止订阅文件过大而消耗过多的流量 + */ + checkUpdateUrl?: string; + + /** + * 此订阅的全局规则组列表 + */ + globalGroups?: RawGlobalGroup[]; + + /** + * 此订阅的应用规则分类列表 + */ + categories?: RawCategory[]; + + /** + * 此订阅的应用列表 + */ + apps?: RawApp[]; +}; diff --git a/api/tsconfig.json b/api/tsconfig.json new file mode 100644 index 0000000..fb7038c --- /dev/null +++ b/api/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ESNext", + "lib": ["ESNext"], + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "isolatedModules": true, + }, + "include": ["./src/**/*.ts", "./tests/**/*.ts"], +} diff --git a/api/typedoc.json b/api/typedoc.json new file mode 100644 index 0000000..da1f725 --- /dev/null +++ b/api/typedoc.json @@ -0,0 +1,16 @@ +{ + "entryPoints": ["../api/src/index.ts"], + "plugin": ["typedoc-plugin-markdown", "typedoc-vitepress-theme"], + "githubPages": false, + "readme": "none", + "indexFormat": "table", + // "useCodeBlocks": true, + "disableSources": true, + "textContentMappings": { + "title.indexPage": "API Reference", + "title.memberPage": "{name}" + }, + "out": "../docs/api", + "docsRoot": "../docs", + "hideBreadcrumbs": true, +} diff --git a/.vitepress/config.ts b/docs/.vitepress/config.ts similarity index 71% rename from .vitepress/config.ts rename to docs/.vitepress/config.ts index 158c69b..3b66586 100644 --- a/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -1,5 +1,8 @@ import { defineConfig } from 'vitepress'; import { mirror, transformHtml } from './plugins'; +import typedocSidebar from '../api/typedoc-sidebar.json'; + +const logoUrl = 'https://registry.npmmirror.com/@gkd-kit/docs/0.0.1706371840771/files/.vitepress/dist/logo.svg' // https://vitepress.dev/reference/site-config export default defineConfig({ @@ -11,15 +14,18 @@ export default defineConfig({ { rel: 'icon', type: 'image/svg+xml', - href: '/logo.svg', + href: logoUrl, }, ], ], lastUpdated: true, themeConfig: { // https://vitepress.dev/reference/default-theme-config - logo: '/logo.svg', - nav: [{ text: '首页', link: '/' }], + logo: logoUrl, + nav: [ + { text: '首页', link: '/' }, + { text: 'API', link: '/api/' }, + ], sidebar: [ { text: '指引', @@ -30,6 +36,15 @@ export default defineConfig({ { text: '疑难解答', link: '/faq/' }, ], }, + { + text: 'API', + link: '/api/', + collapsed: true, + items: typedocSidebar.map((s) => ({ + ...s, + link: s.link.replace('/..\\docs\\api/', '/api/'), + })), + }, ], outline: { label: '页面导航' }, editLink: { diff --git a/.vitepress/env.d.ts b/docs/.vitepress/env.d.ts similarity index 100% rename from .vitepress/env.d.ts rename to docs/.vitepress/env.d.ts diff --git a/.vitepress/plugins/index.ts b/docs/.vitepress/plugins/index.ts similarity index 100% rename from .vitepress/plugins/index.ts rename to docs/.vitepress/plugins/index.ts diff --git a/.vitepress/plugins/mirror.ts b/docs/.vitepress/plugins/mirror.ts similarity index 95% rename from .vitepress/plugins/mirror.ts rename to docs/.vitepress/plugins/mirror.ts index bf2d642..ca0d1a2 100644 --- a/.vitepress/plugins/mirror.ts +++ b/docs/.vitepress/plugins/mirror.ts @@ -84,11 +84,7 @@ export const transformHtml = (code: string) => { }); const links = DomUtils.findAll((e) => { const href = e.attribs.href; - return ( - e.name === 'link' && - !!href && - (href.startsWith('/assets/') || href.startsWith('/logo.svg')) - ); + return e.name === 'link' && !!href && href.startsWith('/assets/'); }, doc.children); links.forEach((e) => { e.attribs.href = mirrorBaseUrl + e.attribs.href; diff --git a/.vitepress/scripts/updateVersion.ts b/docs/.vitepress/scripts/updateVersion.ts similarity index 100% rename from .vitepress/scripts/updateVersion.ts rename to docs/.vitepress/scripts/updateVersion.ts diff --git a/.vitepress/theme/custom.css b/docs/.vitepress/theme/custom.css similarity index 100% rename from .vitepress/theme/custom.css rename to docs/.vitepress/theme/custom.css diff --git a/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts similarity index 100% rename from .vitepress/theme/index.ts rename to docs/.vitepress/theme/index.ts diff --git a/.vitepress/utils/apk.ts b/docs/.vitepress/utils/apk.ts similarity index 100% rename from .vitepress/utils/apk.ts rename to docs/.vitepress/utils/apk.ts diff --git a/faq/index.md b/docs/faq/index.md similarity index 100% rename from faq/index.md rename to docs/faq/index.md diff --git a/guide/index.md b/docs/guide/index.md similarity index 100% rename from guide/index.md rename to docs/guide/index.md diff --git a/index.md b/docs/index.md similarity index 100% rename from index.md rename to docs/index.md diff --git a/docs/package.json b/docs/package.json new file mode 100644 index 0000000..8898d56 --- /dev/null +++ b/docs/package.json @@ -0,0 +1,22 @@ +{ + "name": "@gkd-kit/docs", + "author": "lisonge", + "version": "0.0.0", + "type": "module", + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" + }, + "files": [ + "./.vitepress/dist" + ], + "scripts": { + "docs:dev": "vitepress dev", + "docs:build": "vitepress build", + "docs:preview": "vitepress preview", + "docs:build-mirror": "cross-env MIRROR=ON vitepress build" + }, + "volta": { + "extends": "../package.json" + } +} diff --git a/docs/scription/api.ts b/docs/scription/api.ts new file mode 100644 index 0000000..1480763 --- /dev/null +++ b/docs/scription/api.ts @@ -0,0 +1,428 @@ +export type IArray = T | T[]; + +export type RawCommonProps = { + /** + * 单位: 毫秒 + * + * 当前规则的冷却时间, 或者执行 action 最小间隔 + * + * @default 1000 + */ + actionCd?: number; + + /** + * 单位: 毫秒 + * + * 延迟执行: 查询到节点->等待一段时间->再次查询到节点则执行对应 action + * + */ + actionDelay?: number; + + /** + * + * 如果开启, 此规则下的所有 `末尾属性选择器`的`第一个属性选择表达式`符合下面的结构之一的选择器 将使用快速查找 + * + * - [id='abc'] + * - [vid='abc'] + * - [text='abc'] + * - [text^='abc'] + * - [text*='abc'] + * - [text$='abc'] + * + * 比如 `A > B + C[id='x'][childCount=2]` 符合, 但 `A > B + C[childCount=2][id='x']` 不符合 + * + * 它的底层原理是 跳过手动遍历所有节点 直接调用 [findAccessibilityNodeInfosByViewId](https://developer.android.google.cn/reference/android/view/accessibility/AccessibilityNodeInfo#findAccessibilityNodeInfosByViewId(java.lang.String)) / [findAccessibilityNodeInfosByText](https://developer.android.google.cn/reference/android/view/accessibility/AccessibilityNodeInfo#findAccessibilityNodeInfosByText(java.lang.String)) 得到可匹配节点 + * + * 大多数情况下都能查询到, 在少数某些复杂结构下, 即使目标节点存在, 快速查询也不一定查询到 + * + * 比如 [Image < @View + View >2 [text*='广告']](https://github.com/gkd-kit/subscription/blob/1ae87452d287b558f58f9c4e4448a3190e212ca1/src/apps/com.zidongdianji.ts#L26) 虽然符合快速查询的条件但是使用 `findAccessibilityNodeInfosByText("广告")` 并不能查询到节点 + * + * 它是优点是快速, 因为遍历所有节点是一个耗时行为, 虽然多数情况下这种耗时较低 + * + * 但是在某些软件比如 哔哩哔哩 的开屏广告在这种耗时下延迟可达 1-2s, 这也是导致 [gkd-kit/gkd#60](https://github.com/gkd-kit/gkd/issues/60) 的原因 + * + * --- + * + * v1.4.1 版本后生成的快照时将标识每个节点是否可 quickFind, 网页审查工具属性面板顶部会注明这个标识 + * + * [![image](https://github.com/gkd-kit/subscription/assets/38517192/80cdbad1-fa8d-4415-81a1-cecaa7d69e33)](https://i.gkd.li/import/13316168) + * + */ + quickFind?: boolean; + + /** + * 单位: 毫秒 + * + * 匹配延迟 + * + * 规则准备匹配/或被唤醒时, 等待一段时间, 使此规则参与查询屏幕节点 + * + */ + matchDelay?: number; + + /** + * 单位: 毫秒 + * + * 规则匹配时间, 此规则参与查询屏幕节点时, 等待一段时间, 休眠此规则 + * + * 例如某些应用的 开屏广告 的 activityId 容易误触/太广泛, 而开屏广告几乎只在应用切出来时出现, 设置一个有限匹配时间能避免后续的误触 + * + */ + matchTime?: number; + + /** + * 最大执行次数 + * + * 规则的 action 被执行的最大次数, 达到最大次数时, 休眠此规则 + * + * 功能类似 matchTime, 适用于只需要执行一次的: 开屏广告/更新弹窗/青少年弹窗 一类规则 + * + * 当规则准备匹配/或被唤醒时, 将重新计算次数 + * + */ + actionMaximum?: number; + + /** + * 当规则因为 matchTime/actionMaximum 而休眠时, 如何唤醒此规则 + * + * @default 'activity' + * + * @example + * 'activity' + * // 当 activity 刷新时, 唤醒规则 + * // 刷新 activity 并不代表 activityId 变化 + * // 如 哔哩哔哩视频播放页 底部点击推荐视频 进入另一个 视频播放页, 进入了新 activity 但是 activityId 并没有变化 + * + * @example + * 'app' + * // 重新进入 app 时, 唤醒规则 + */ + resetMatch?: 'activity' | 'app'; + + /** + * 与这个 key 的 rule 共享 cd + * + * 比如开屏广告可能需要多个 rule 去匹配, 当一个 rule 触发时, 其它 rule 的触发是无意义的 + * + * 如果你对这个 key 的 rule 设置 actionCd=3000, 那么当这个 rule 和 本 rule 触发任意一个时, 在 3000毫秒 内两个 rule 都将进入 cd + */ + actionCdKey?: number; + + /** + * 与这个 key 的 rule 共享次数 + * + * 比如开屏广告可能需要多个 rule 去匹配, 当一个 rule 触发时, 其它 rule 的触发是无意义的 + * + * 如果你对这个 key 的 rule 设置 actionMaximum=1, 那么当这个 rule 和 本 rule 触发任意一个时, 两个 rule 都将进入休眠 + */ + actionMaximumKey?: number; + + /** + * 规则参与匹配的顺序, 数字越小越先匹配 + * + * 如果两个规则 order 相同, 按照 groups 中的数组顺序匹配, app 类型规则顺序优先于 global 类型规则 + * + * 属于不同订阅的规则按照订阅列表中顺序匹配, 长按订阅卡片可以拖动排序 + * + * @default 0 + * + */ + order?: number; + + /** + * 当前 规则/规则组 的快照链接, 增强订阅可维护性 + */ + snapshotUrls?: IArray; + + /** + * 当前 规则/规则组 的规则在手机上的运行示例, 支持 jpg/png/webp/gif + * + * 如果规则是多个规则组合起来的, 可以更好看懂规则到底在干啥, 比如 点击关闭按钮-选择关闭原因-确认关闭 这种广告用 gif 看着更清楚在干啥 + */ + exampleUrls?: IArray; +}; + +export type RawRuleProps = RawCommonProps & { + /** + * 当前规则在列表中的唯一标识 + * + * key 没有顺序大小之分, 可以是任意数字 + * + * 设置后不可更改, 否则造成点击记录错乱 + */ + key?: number; + + name?: string; + + /** + * 要求当前列表里某个 key 刚刚执行 + * + * 比如点击关闭按钮-选择关闭原因-确认关闭, key 分别是 1,2,3, preKeys 分别是 [],[1],[2] + * + * 那么 选择关闭原因 必须要求 比如点击关闭按钮 刚刚点击过才能执行, 确认关闭 也要求 选择关闭原因 刚刚点击过才执行 + * + * 否则后面的规则不会触发, 也就是要求规则按顺序执行, 这是为了防止规则匹配范围太过广泛而误触 + * + */ + preKeys?: IArray; + + /** + * @example + * `click` + * // 为默认值, 如果目标节点是 clickable 的, 则使用 `clickNode`, 反之使用 `clickCenter` + * // 并且当 `clickNode` 事件没有被应用接收时, 则使用 `clickCenter` + * + * @example + * `clickNode` + * // 向系统发起一个点击无障碍节点事件. 即使节点在屏幕外部/或者被其它节点遮挡,也依然能够正确触发点击目标节点 + * // 但是如果目标节点不是 clickable 的, 目标 APP 通常不响应这个点击事件, 也就是点击无效果 + * // 在极少数情况下, 即使节点是 clickable 的, APP 显示接收但是不响应节点点击事件, 此时需要手动设置 `clickCenter` + * + * @example + * `clickCenter` + * // 计算出此控件的中心的坐标并且如果这个坐标在屏幕内部,那么就向系统发起一个点击屏幕坐标事件 + * // 如果这个坐标不在屏幕内部, 当作未匹配 + * // 另外如果目标节点的位置被其它节点遮挡覆盖, 则会点击触发最上层的节点(可能不是目标节点) + * + * @example + * `back` + * // 向系统发起一个返回事件, 相当于按下返回键 + * + * @example + * `longClick` + * // 如果目标节点是 longClickable 的, 则使用 `longClickNode`, 反之使用 `longClickCenter` + * // 并且当 `longClickNode` 事件没有被应用接收时, 则使用 `longClickCenter` + * + * @example + * `longClickNode` + * // 向系统发起一个长按无障碍节点事件,与 clickNode 类似 + * + * @example + * `longClickCenter` + * // 与 clickCenter 类似, 长按时间为 400 毫秒 + */ + action?: + | 'click' + | 'clickNode' + | 'clickCenter' + | 'back' + | 'longClick' + | 'longClickNode' + | 'longClickCenter'; + + /** + * 一个或者多个合法的 GKD 选择器, 如果每个选择器都能匹配上节点, 那么点击最后一个选择器的目标节点 + */ + matches?: IArray; + + /** + * 一个或者多个合法的 GKD 选择器, 如果存在一个选择器匹配上节点, 则停止匹配此规则 + */ + excludeMatches?: IArray; +}; + +export type RawGroupProps = RawCommonProps & { + /** + * 当前规则组在列表中的唯一标识 + * + * 也是客户端禁用/启用此规则组的依据 + * + * 设置后不可更改, 否则造成客户端启用/禁用错乱 + * + * key 没有顺序大小之分, 可以是任意数字 + */ + key: number; + + name: string; + desc?: string; + + /** + * 控制规则默认情况下是启用还是禁用, 默认启用 + * + * 仅对于本仓库的规则而言, 除开屏广告外, 其它规则默认禁用 + */ + enable?: boolean; + + /** + * 其它 group 的 key, 允许将目标组的所有 rule 添加到当前组的作用域 + * + * 假设 group1{key=1} 有一个 rule1{key=11}, group2{key=2} 有 rule2{key=22}, rule3{key=23} + * + * 如果 group1 的 scopeKeys=[2] 并且 group2 没有被禁用, 那么 rule1 的 preKeys/actionCdKey/actionMaximumKey 可以是 11/22/23 + * + * 如果存在相同 key 的 rule, 优先使用本组的 rule, 其次按 scopeKeys 的顺序查找其它组的 rule + * + */ + scopeKeys?: IArray; + + // rules: RawRuleProps[]; +}; + +export type RawAppRuleProps = { + /** + * 如果 设备界面Id startWith activityIds 的任意一项, 则匹配 + * + * 如果要匹配所有界面: `undefined` (不填写) 或者 `[]` (避免使用上级属性) + */ + activityIds?: IArray; + + /** + * 如果 设备界面Id startWith excludeActivityIds 的任意一项, 则排除匹配 + * + * 优先级高于 activityIds + */ + excludeActivityIds?: IArray; +}; + +// <--全局规则相关-- +export type RawGlobalApp = RawAppRuleProps & { + id: string; + /** + * 默认值: `true` + * + * true => 在此 APP 启用此规则 + * + * false => 在此 APP 禁用此规则 + */ + enable?: boolean; +}; +export type RawGlobalRuleProps = { + /** + * 默认值: `true` + * + * true => 匹配任意 APP + * + * false => 仅匹配 apps 里面的 app + */ + matchAnyApp?: boolean; + + /** + * 默认值: `false` + * + * 是否匹配桌面, 仅全局规则可用 + * + * 如果你切换了桌面, 你需要打开 GKD 的界面触发识别新桌面 + */ + matchLauncher?: boolean; + + /** + * 默认值: `false` + * + * 是否匹配系统应用, 仅全局规则可用 + */ + matchSystemApp?: boolean; + + apps?: RawGlobalApp[]; +}; + +export type RawGlobalRule = RawRuleProps & RawGlobalRuleProps; + +export type RawGlobalGroup = RawGroupProps & + RawGlobalRuleProps & { + apps?: RawGlobalApp[]; + rules: RawGlobalRule[]; + }; +// --全局规则相关--> + +// <--APP规则相关-- +export type RawCategory = { + /** + * 当前分类在列表中的唯一标识 + * + * 也是客户端禁用/启用此分类组的依据 + */ + key: number; + + /** + * 分类名称 + * + * 同时也是分类的依据, 捕获以 name 开头的所有 APP 规则组, 不捕获全局规则组 + * + * 示例: `开屏广告` 将捕获 `开屏广告-1` `开屏广告-2` `开屏广告-233` 这类 APP 规则组 + */ + name: string; + + /** + * null => 跟随捕获的规则组的 enable 的默认值 + * + * true => 全部启用捕获的规则组 + * + * false => 全部禁用捕获的规则组 + */ + enable?: boolean; +}; + +export type RawAppRule = RawRuleProps & RawAppRuleProps; +export type RawAppGroup = RawGroupProps & + RawAppRuleProps & { + /** + * string => { matches: string } + * + * string[] => { matches: string }[] + */ + rules: IArray; + }; + +export type RawApp = { + id: string; + + /** + * 如果设备没有安装这个 APP, 则使用这个 name 显示 + */ + name?: string; + + groups: RawAppGroup[]; +}; +// --APP规则相关--> + +export type RawSubscription = { + /** + * 当前订阅文件的标识, 如果新旧订阅文件id不一致则更新失败\ + * 范围: `[0, Number.MAX_SAFE_INTEGER]`\ + * 建议值: `new Date().getTime()` + * + * GKD默认订阅是 0, 负数 id APP 自己内部使用, APP 不允许用户添加负数 id 的订阅 + * + * 负数订阅由 APP 内部使用, 如本地订阅是 -2, 内存订阅是 -1 + */ + id: number; + + /** + * 订阅的名称 + */ + name: string; + + /** + * 订阅的版本号, 用于检测更新 + * + * 只有当新订阅的 version 大于本地旧订阅的 version 才执行更新替换本地 + */ + version: number; + + author?: string; + + /** + * GKD 会定时或者用户手动刷新请求这个链接, 如果返回的订阅的 version 大于 APP 订阅当前的 version , 则更新 + * + * 如果这个字段不存在, 则使用添加订阅时填写的链接 + */ + updateUrl?: string; + + /** + * 一个自定义 uri 链接, 用户点击[用户反馈]时, 打开此链接 + * + * 可以是一个网页链接, 也可以是一个 APP 内部的 uri 链接 + */ + supportUri?: string; + + /** + * 一个只需要 id 和 version 的 json 文件链接, 检测更新时, 优先检测此链接, 如果 id 相等并且 version 增加, 则再去请求 updateUrl + * + * 目的是防止订阅文件过大而消耗过多的流量 + */ + checkUpdateUrl?: string; + + globalGroups?: RawGlobalGroup[]; + categories?: RawCategory[]; + apps?: RawApp[]; +}; diff --git a/scription/index.md b/docs/scription/index.md similarity index 100% rename from scription/index.md rename to docs/scription/index.md diff --git a/selector/index.md b/docs/selector/index.md similarity index 100% rename from selector/index.md rename to docs/selector/index.md diff --git a/tsconfig.json b/docs/tsconfig.json similarity index 100% rename from tsconfig.json rename to docs/tsconfig.json diff --git a/package.json b/package.json index 832a20a..043428e 100644 --- a/package.json +++ b/package.json @@ -1,40 +1,30 @@ { - "name": "@gkd-kit/docs", - "author": "lisonge", - "version": "0.0.0", + "name": "gkd-monorepo", + "private": true, "type": "module", - "publishConfig": { - "access": "public", - "registry": "https://registry.npmjs.org/" - }, - "files": [ - "./.vitepress/dist" - ], "scripts": { - "docs:dev": "vitepress dev", - "docs:build": "vitepress build", - "docs:preview": "vitepress preview", - "docs:build-mirror": "cross-env MIRROR=ON vitepress build", "format": "prettier --cache --write --ignore-unknown ." }, "dependencies": { - "@gkd-kit/selector": "0.0.18", - "@types/node": "^20.11.5", "@types/qrcode": "^1.5.5", "acorn-walk": "^8.3.2", "cross-env": "^7.0.3", "dom-serializer": "^2.0.0", "htmlparser2": "^9.1.0", - "magic-string": "^0.30.5", + "magic-string": "^0.30.6", "medium-zoom": "^1.1.0", - "prettier": "^3.2.4", "qrcode": "^1.5.3", + "typedoc": "^0.25.7", + "typedoc-plugin-markdown": "^4.0.0-next.47", + "typedoc-vitepress-theme": "^1.0.0-next.8", + "vitepress": "^1.0.0-rc.40", + "@gkd-kit/selector": "0.0.20", + "@types/node": "^20.11.15", + "prettier": "^3.2.4", "tsx": "^4.7.0", - "typescript": "^5.3.3", - "vitepress": "^1.0.0-rc.39" + "typescript": "^5.3.3" }, "volta": { - "node": "20.10.0" - }, - "packageManager": "pnpm@8.11.0" -} \ No newline at end of file + "node": "20.11.0" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1e058f1..915d705 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,49 +4,65 @@ settings: autoInstallPeers: false excludeLinksFromLockfile: false -dependencies: - '@gkd-kit/selector': - specifier: 0.0.18 - version: 0.0.18 - '@types/node': - specifier: ^20.11.5 - version: 20.11.5 - '@types/qrcode': - specifier: ^1.5.5 - version: 1.5.5 - acorn-walk: - specifier: ^8.3.2 - version: 8.3.2 - cross-env: - specifier: ^7.0.3 - version: 7.0.3 - dom-serializer: - specifier: ^2.0.0 - version: 2.0.0 - htmlparser2: - specifier: ^9.1.0 - version: 9.1.0 - magic-string: - specifier: ^0.30.5 - version: 0.30.5 - medium-zoom: - specifier: ^1.1.0 - version: 1.1.0 - prettier: - specifier: ^3.2.4 - version: 3.2.4 - qrcode: - specifier: ^1.5.3 - version: 1.5.3 - tsx: - specifier: ^4.7.0 - version: 4.7.0 - typescript: - specifier: ^5.3.3 - version: 5.3.3 - vitepress: - specifier: ^1.0.0-rc.39 - version: 1.0.0-rc.39(@types/node@20.11.5)(qrcode@1.5.3)(typescript@5.3.3) +importers: + + .: + dependencies: + '@gkd-kit/selector': + specifier: 0.0.20 + version: 0.0.20 + '@types/node': + specifier: ^20.11.15 + version: 20.11.15 + '@types/qrcode': + specifier: ^1.5.5 + version: 1.5.5 + acorn-walk: + specifier: ^8.3.2 + version: 8.3.2 + cross-env: + specifier: ^7.0.3 + version: 7.0.3 + dom-serializer: + specifier: ^2.0.0 + version: 2.0.0 + htmlparser2: + specifier: ^9.1.0 + version: 9.1.0 + magic-string: + specifier: ^0.30.6 + version: 0.30.6 + medium-zoom: + specifier: ^1.1.0 + version: 1.1.0 + prettier: + specifier: ^3.2.4 + version: 3.2.4 + qrcode: + specifier: ^1.5.3 + version: 1.5.3 + tsx: + specifier: ^4.7.0 + version: 4.7.0 + typedoc: + specifier: ^0.25.7 + version: 0.25.7(typescript@5.3.3) + typedoc-plugin-markdown: + specifier: ^4.0.0-next.47 + version: 4.0.0-next.47(typedoc@0.25.7) + typedoc-vitepress-theme: + specifier: ^1.0.0-next.8 + version: 1.0.0-next.8(typedoc-plugin-markdown@4.0.0-next.47) + typescript: + specifier: ^5.3.3 + version: 5.3.3 + vitepress: + specifier: ^1.0.0-rc.40 + version: 1.0.0-rc.40(@types/node@20.11.15)(qrcode@1.5.3)(typescript@5.3.3) + + api: {} + + docs: {} packages: @@ -457,8 +473,8 @@ packages: dev: false optional: true - /@gkd-kit/selector@0.0.18: - resolution: {integrity: sha512-5aDHh45pkRLd82d+TLE5vbaz64PkcYZABOuqCXhsEQW8PtNMT05sTTW6WQeM+RH/IjGvULz/p9Hl8vpVm2bPCg==} + /@gkd-kit/selector@0.0.20: + resolution: {integrity: sha512-dnuEF8r0GmlC7G3AKYwQp8su0QbStjz2M2j7E/rvZ5IGr+txXxkBe69jezmZeCflRX6S0P3eWJMrZLoJNHNb3g==} dev: false /@jridgewell/sourcemap-codec@1.4.15: @@ -576,8 +592,8 @@ packages: resolution: {integrity: sha512-T5k6kTXak79gwmIOaDF2UUQXFbnBE0zBUzF20pz7wDYu0RQMzWg+Ml/Pz50214NsFHBITkoi5VtdjFZnJ2ijjA==} dev: false - /@types/node@20.11.5: - resolution: {integrity: sha512-g557vgQjUUfN76MZAN/dt1z3dzcUsimuysco0KeluHgrPdJXkP/XdAURgyO2W9fZWHRtRBiVKzKn8vyOAwlG+w==} + /@types/node@20.11.15: + resolution: {integrity: sha512-gscmuADZfvNULx1eyirVbr3kVOVZtpQtzKMCZpeSZcN6MfbkRXAR4s9/gsQ4CzxLHw6EStDtKLNtSDL3vbq05A==} dependencies: undici-types: 5.26.5 dev: false @@ -585,21 +601,21 @@ packages: /@types/qrcode@1.5.5: resolution: {integrity: sha512-CdfBi/e3Qk+3Z/fXYShipBT13OJ2fDO2Q2w5CIP5anLTLIndQG9z6P1cnm+8zCWSpm5dnxMFd/uREtb0EXuQzg==} dependencies: - '@types/node': 20.11.5 + '@types/node': 20.11.15 dev: false /@types/web-bluetooth@0.0.20: resolution: {integrity: sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==} dev: false - /@vitejs/plugin-vue@5.0.3(vite@5.0.11)(vue@3.4.15): + /@vitejs/plugin-vue@5.0.3(vite@5.0.12)(vue@3.4.15): resolution: {integrity: sha512-b8S5dVS40rgHdDrw+DQi/xOM9ed+kSRZzfm1T74bMmBDCd8XO87NKlFYInzCtwvtWwXZvo1QxE2OSspTATWrbA==} engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: vite: ^5.0.0 vue: ^3.2.25 dependencies: - vite: 5.0.11(@types/node@20.11.5) + vite: 5.0.12(@types/node@20.11.15) vue: 3.4.15(typescript@5.3.3) dev: false @@ -629,7 +645,7 @@ packages: '@vue/compiler-ssr': 3.4.15 '@vue/shared': 3.4.15 estree-walker: 2.0.2 - magic-string: 0.30.5 + magic-string: 0.30.6 postcss: 8.4.33 source-map-js: 1.0.2 dev: false @@ -785,6 +801,10 @@ packages: engines: {node: '>=8'} dev: false + /ansi-sequence-parser@1.1.1: + resolution: {integrity: sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==} + dev: false + /ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} @@ -792,6 +812,16 @@ packages: color-convert: 2.0.1 dev: false + /balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: false + + /brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.2 + dev: false + /camelcase@5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} @@ -972,6 +1002,10 @@ packages: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: false + /jsonc-parser@3.2.1: + resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==} + dev: false + /locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -979,8 +1013,12 @@ packages: p-locate: 4.1.0 dev: false - /magic-string@0.30.5: - resolution: {integrity: sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==} + /lunr@2.3.9: + resolution: {integrity: sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==} + dev: false + + /magic-string@0.30.6: + resolution: {integrity: sha512-n62qCLbPjNjyo+owKtveQxZFZTBm+Ms6YoGD23Wew6Vw337PElFNifQpknPruVRQV57kVShPnLGo9vWxVhpPvA==} engines: {node: '>=12'} dependencies: '@jridgewell/sourcemap-codec': 1.4.15 @@ -990,10 +1028,23 @@ packages: resolution: {integrity: sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==} dev: false + /marked@4.3.0: + resolution: {integrity: sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==} + engines: {node: '>= 12'} + hasBin: true + dev: false + /medium-zoom@1.1.0: resolution: {integrity: sha512-ewyDsp7k4InCUp3jRmwHBRFGyjBimKps/AJLjRSox+2q/2H4p/PNpQf+pwONWlJiOudkBXtbdmVbFjqyybfTmQ==} dev: false + /minimatch@9.0.3: + resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: false + /minisearch@6.3.0: resolution: {integrity: sha512-ihFnidEeU8iXzcVHy74dhkxh/dn8Dc08ERl0xwoMMGqp4+LvRSCgicb+zGqWthVokQKvCSxITlh3P08OzdTYCQ==} dev: false @@ -1042,15 +1093,6 @@ packages: engines: {node: '>=10.13.0'} dev: false - /postcss@8.4.32: - resolution: {integrity: sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==} - engines: {node: ^10 || ^12 || >=14} - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.0 - source-map-js: 1.0.2 - dev: false - /postcss@8.4.33: resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==} engines: {node: ^10 || ^12 || >=14} @@ -1130,20 +1172,29 @@ packages: engines: {node: '>=8'} dev: false - /shikiji-core@0.9.19: - resolution: {integrity: sha512-AFJu/vcNT21t0e6YrfadZ+9q86gvPum6iywRyt1OtIPjPFe25RQnYJyxHQPMLKCCWA992TPxmEmbNcOZCAJclw==} + /shiki@0.14.7: + resolution: {integrity: sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==} + dependencies: + ansi-sequence-parser: 1.1.1 + jsonc-parser: 3.2.1 + vscode-oniguruma: 1.7.0 + vscode-textmate: 8.0.0 dev: false - /shikiji-transformers@0.9.19: - resolution: {integrity: sha512-lGLI7Z8frQrIBbhZ74/eiJtxMoCQRbpaHEB+gcfvdIy+ZFaAtXncJGnc52932/UET+Y4GyKtwwC/vjWUCp+c/Q==} - dependencies: - shikiji: 0.9.19 + /shikiji-core@0.10.2: + resolution: {integrity: sha512-9Of8HMlF96usXJHmCL3Gd0Fcf0EcyJUF9m8EoAKKd98mHXi0La2AZl1h6PegSFGtiYcBDK/fLuKbDa1l16r1fA==} dev: false - /shikiji@0.9.19: - resolution: {integrity: sha512-Kw2NHWktdcdypCj1GkKpXH4o6Vxz8B8TykPlPuLHOGSV8VkhoCLcFOH4k19K4LXAQYRQmxg+0X/eM+m2sLhAkg==} + /shikiji-transformers@0.10.2: + resolution: {integrity: sha512-7IVTwl1af205ywYEq5bOAYOTOFW4V1dVX1EablP0nWKErqZeD1o93VMytxmtJomqS+YwbB8doY8SE3MFMn0aPQ==} dependencies: - shikiji-core: 0.9.19 + shikiji: 0.10.2 + dev: false + + /shikiji@0.10.2: + resolution: {integrity: sha512-wtZg3T0vtYV2PnqusWQs3mDaJBdCPWxFDrBM/SE5LfrX92gjUvfEMlc+vJnoKY6Z/S44OWaCRzNIsdBRWcTAiw==} + dependencies: + shikiji-core: 0.10.2 dev: false /source-map-js@1.0.2: @@ -1187,6 +1238,36 @@ packages: fsevents: 2.3.3 dev: false + /typedoc-plugin-markdown@4.0.0-next.47(typedoc@0.25.7): + resolution: {integrity: sha512-PkDUqxbXZuYBSR9rtxhu6PCbJyAQYwCf6ypA6/shcdCLY8vt08dHsT3W3dFY9AZ9Y4Ya9zbIs0tQufUtUzbsxw==} + peerDependencies: + typedoc: 0.25.x + dependencies: + typedoc: 0.25.7(typescript@5.3.3) + dev: false + + /typedoc-vitepress-theme@1.0.0-next.8(typedoc-plugin-markdown@4.0.0-next.47): + resolution: {integrity: sha512-t7U+1rDEOCDbv1l2id2I94ylCvbo2jJayRJ1sq4Dbnt0vzxT7LAzTFdXhT5+/2WiAGnsHnVndb3ywRgEVKa8BQ==} + peerDependencies: + typedoc-plugin-markdown: '>=4.0.0-next.44' + dependencies: + typedoc-plugin-markdown: 4.0.0-next.47(typedoc@0.25.7) + dev: false + + /typedoc@0.25.7(typescript@5.3.3): + resolution: {integrity: sha512-m6A6JjQRg39p2ZVRIN3NKXgrN8vzlHhOS+r9ymUYtcUP/TIQPvWSq7YgE5ZjASfv5Vd5BW5xrir6Gm2XNNcOow==} + engines: {node: '>= 16'} + hasBin: true + peerDependencies: + typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x + dependencies: + lunr: 2.3.9 + marked: 4.3.0 + minimatch: 9.0.3 + shiki: 0.14.7 + typescript: 5.3.3 + dev: false + /typescript@5.3.3: resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} engines: {node: '>=14.17'} @@ -1197,8 +1278,8 @@ packages: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} dev: false - /vite@5.0.11(@types/node@20.11.5): - resolution: {integrity: sha512-XBMnDjZcNAw/G1gEiskiM1v6yzM4GE5aMGvhWTlHAYYhxb7S3/V1s3m2LDHa8Vh6yIWYYB0iJwsEaS523c4oYA==} + /vite@5.0.12(@types/node@20.11.15): + resolution: {integrity: sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -1225,16 +1306,16 @@ packages: terser: optional: true dependencies: - '@types/node': 20.11.5 + '@types/node': 20.11.15 esbuild: 0.19.11 - postcss: 8.4.32 + postcss: 8.4.33 rollup: 4.6.1 optionalDependencies: fsevents: 2.3.3 dev: false - /vitepress@1.0.0-rc.39(@types/node@20.11.5)(qrcode@1.5.3)(typescript@5.3.3): - resolution: {integrity: sha512-EcgoRlAAp37WOxUOYv45oxyhLrcy3Upey+mKpqW3ldsg6Ol4trPndRBk2GO0QiSvEKlb9BMerk49D/bFICN6kg==} + /vitepress@1.0.0-rc.40(@types/node@20.11.15)(qrcode@1.5.3)(typescript@5.3.3): + resolution: {integrity: sha512-1x9PCrcsJwqhpccyTR93uD6jpiPDeRC98CBCAQLLBb44a3VSXYBPzhCahi+2kwAYylu49p0XhseMPVM4IVcWcw==} hasBin: true peerDependencies: markdown-it-mathjax3: ^4.3.2 @@ -1248,17 +1329,17 @@ packages: '@docsearch/css': 3.5.2 '@docsearch/js': 3.5.2 '@types/markdown-it': 13.0.7 - '@vitejs/plugin-vue': 5.0.3(vite@5.0.11)(vue@3.4.15) + '@vitejs/plugin-vue': 5.0.3(vite@5.0.12)(vue@3.4.15) '@vue/devtools-api': 6.5.1 '@vueuse/core': 10.7.2(vue@3.4.15) '@vueuse/integrations': 10.7.2(focus-trap@7.5.4)(qrcode@1.5.3)(vue@3.4.15) focus-trap: 7.5.4 mark.js: 8.11.1 minisearch: 6.3.0 - shikiji: 0.9.19 - shikiji-core: 0.9.19 - shikiji-transformers: 0.9.19 - vite: 5.0.11(@types/node@20.11.5) + shikiji: 0.10.2 + shikiji-core: 0.10.2 + shikiji-transformers: 0.10.2 + vite: 5.0.12(@types/node@20.11.15) vue: 3.4.15(typescript@5.3.3) transitivePeerDependencies: - '@algolia/client-search' @@ -1288,6 +1369,14 @@ packages: - universal-cookie dev: false + /vscode-oniguruma@1.7.0: + resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==} + dev: false + + /vscode-textmate@8.0.0: + resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} + dev: false + /vue-demi@0.14.6(vue@3.4.15): resolution: {integrity: sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==} engines: {node: '>=12'} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..51dfc37 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,3 @@ +packages: + - 'docs' + - 'api' diff --git a/public/.nojekyll b/public/.nojekyll deleted file mode 100644 index e69de29..0000000 diff --git a/public/CNAME b/public/CNAME deleted file mode 100644 index 93b8a5d..0000000 --- a/public/CNAME +++ /dev/null @@ -1 +0,0 @@ -gkd.li \ No newline at end of file diff --git a/public/logo.svg b/public/logo.svg deleted file mode 100644 index 9526fc4..0000000 --- a/public/logo.svg +++ /dev/null @@ -1,2713 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file