From 350f0a9096d87e037fa1f9c586d3b3add14f0b18 Mon Sep 17 00:00:00 2001 From: Zechariah Date: Tue, 29 Mar 2022 22:05:40 +0800 Subject: [PATCH] Added Vue CodeLink component --- docs/.vuepress/components/CodeLink.vue | 66 +++++++++++++++++++++ docs/.vuepress/config.ts | 11 ++++ docs/references/interfaces/AlbumBasic.md | 21 +++++++ docs/references/interfaces/AlbumDetailed.md | 27 +++++++++ package.json | 1 + pnpm-lock.yaml | 12 ++++ 6 files changed, 138 insertions(+) create mode 100644 docs/.vuepress/components/CodeLink.vue diff --git a/docs/.vuepress/components/CodeLink.vue b/docs/.vuepress/components/CodeLink.vue new file mode 100644 index 0000000..95e9a97 --- /dev/null +++ b/docs/.vuepress/components/CodeLink.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index b80435d..92e88e7 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -1,9 +1,20 @@ import { defineUserConfig } from "vuepress" +import { path } from "@vuepress/utils" import type { DefaultThemeOptions } from "vuepress" export default defineUserConfig({ title: "YTMusic API", description: "Unofficial YouTube Music API for TypeScript", + plugins: [ + [ + "@vuepress/register-components", + { + components: { + CodeLink: path.resolve(__dirname, "./components/CodeLink.vue") + } + } + ] + ], themeConfig: { repo: "zS1L3NT/ts-npm-ytmusic-api", editLink: false, diff --git a/docs/references/interfaces/AlbumBasic.md b/docs/references/interfaces/AlbumBasic.md index e69de29..68c934c 100644 --- a/docs/references/interfaces/AlbumBasic.md +++ b/docs/references/interfaces/AlbumBasic.md @@ -0,0 +1,21 @@ +# AlbumBasic + +## Properties + +| Name | Data Type | Description | +| :-------- | :-------- | :---------- | +| `albumId` | `string` | Album ID | +| `name` | `string` | Name | + +## TypeScript Source Code + +```ts +interface AlbumBasic { + albumId: string + name: string +} +``` + +## Usages + +[SongDetailed#album](./SongDetailed.html) diff --git a/docs/references/interfaces/AlbumDetailed.md b/docs/references/interfaces/AlbumDetailed.md index e69de29..e8aec98 100644 --- a/docs/references/interfaces/AlbumDetailed.md +++ b/docs/references/interfaces/AlbumDetailed.md @@ -0,0 +1,27 @@ +# AlbumDetailed + +## Properties + +| Name | Data Type | Description | +| :----------- | :------------------------------------------------------------------------- | :-------------------- | +| `type` | `"ALBUM"` | Type of data | +| `albumId` | `string` | Album ID | +| `playlistId` | `string` | Playlist ID for Album | +| `name` | `string` | Name | +| `artists` | | Creators of the Album | +| `year` | `number` | Publication Year | +| `thumbnails` | `ThumbnailFull[]` | Thumbnails | + +## TypeScript Source Code + +```ts +interface AlbumBasic { + type: "ALBUM" + albumId: string + playlistId: string + name: string + artists: ArtistBasic[] + year: number + thumbnails: ThumbnailFull[] +} +``` diff --git a/package.json b/package.json index 0be84e5..fe9596e 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "@types/mocha": "^9.1.0", "@types/node": "^17.0.23", "@types/tough-cookie": "^4.0.1", + "@vuepress/plugin-register-components": "^2.0.0-beta.36", "mocha": "^9.2.2", "mocha.parallel": "^0.15.6", "ts-mocha": "^9.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 858dbd3..8b4d76b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,7 @@ specifiers: '@types/mocha': ^9.1.0 '@types/node': ^17.0.23 '@types/tough-cookie': ^4.0.1 + '@vuepress/plugin-register-components': ^2.0.0-beta.36 axios: ^0.25.0 mocha: ^9.2.2 mocha.parallel: ^0.15.6 @@ -22,6 +23,7 @@ devDependencies: '@types/mocha': 9.1.0 '@types/node': 17.0.23 '@types/tough-cookie': 4.0.1 + '@vuepress/plugin-register-components': 2.0.0-beta.36 mocha: 9.2.2 mocha.parallel: 0.15.6_mocha@9.2.2 ts-mocha: 9.0.2_mocha@9.2.2 @@ -389,6 +391,16 @@ packages: - supports-color dev: true + /@vuepress/plugin-register-components/2.0.0-beta.36: + resolution: {integrity: sha512-ciIDC8t4r9n1wbVVwvfcOY/iZ2s8tka3XThs1zrfja2l7TI9BX6+wCT9N/TO+1pOjYhn6938FmTrv4kK69eRFA==} + dependencies: + '@vuepress/core': 2.0.0-beta.36 + '@vuepress/utils': 2.0.0-beta.35 + chokidar: 3.5.3 + transitivePeerDependencies: + - supports-color + dev: true + /@vuepress/plugin-theme-data/2.0.0-beta.36: resolution: {integrity: sha512-1Fxj7F0rIARYa/gQmsUql3f7wPF3ML4Fs6kcPHXYll7ZNDLR1OBw9HIGJ7lW4qx37f6YfYs2RjefAuwkVFUn/A==} dependencies: