diff --git a/package.json b/package.json index 4b7eaec..9b9c2f9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "niplayer", - "version": "1.3.6", + "version": "1.4.0", "description": "This is a TS library for video player", "main": "./dist/player.esm.js", "types": "./dist/index.d.ts", @@ -8,6 +8,7 @@ "dev": "rollup -c script/rollup.config.dev.js --watch", "build": "rollup -c script/rollup.config.prod.js", "build:tsc": "tsc", + "build:dts": "dts-bundle-generator -o ./dist/index.d.ts ./src/index.ts --project tsconfig.json --no-check", "test": "vitest", "coverage": "vitest run --coverage" }, @@ -31,6 +32,7 @@ "@types/node": "^18.13.0", "@vitest/coverage-c8": "^0.27.2", "autoprefixer": "^8.0.0", + "dts-bundle-generator": "^8.0.0", "less": "^4.1.3", "postcss": "^8.4.21", "rollup": "^2.79.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cbdd7bc..51da1c1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,6 +16,7 @@ specifiers: '@vitest/coverage-c8': ^0.27.2 autoprefixer: ^8.0.0 be-full: ^0.1.4 + dts-bundle-generator: ^8.0.0 less: ^4.1.3 mp4box: ^0.5.2 ntouch.js: ^1.1.0 @@ -52,6 +53,7 @@ devDependencies: '@types/node': 18.13.0 '@vitest/coverage-c8': 0.27.3_less@4.1.3 autoprefixer: 8.6.5 + dts-bundle-generator: 8.0.0 less: 4.1.3 postcss: 8.4.21 rollup: 2.79.1 @@ -1958,6 +1960,15 @@ packages: wrap-ansi: 7.0.0 dev: true + /cliui/8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + /color-convert/1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} dependencies: @@ -2197,6 +2208,15 @@ packages: domhandler: 4.3.1 dev: true + /dts-bundle-generator/8.0.0: + resolution: {integrity: sha512-9Du4uQLRs/doabHzVDFIKsbUA9KHdPkfd0YRgsJ7rXtVSKCfuW0EsM/d2AoXw2fNgxcSfJ01/8szOy4u6ze/2g==} + engines: {node: '>=14.0.0'} + hasBin: true + dependencies: + typescript: 5.0.3 + yargs: 17.7.1 + dev: true + /electron-to-chromium/1.4.284: resolution: {integrity: sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==} dev: true @@ -3846,6 +3866,12 @@ packages: hasBin: true dev: true + /typescript/5.0.3: + resolution: {integrity: sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==} + engines: {node: '>=12.20'} + hasBin: true + dev: true + /ufo/1.0.1: resolution: {integrity: sha512-boAm74ubXHY7KJQZLlXrtMz52qFvpsbOxDcZOnw/Wf+LS4Mmyu7JxmzD4tDLtUQtmZECypJ0FrCz4QIe6dvKRA==} dev: true @@ -4094,6 +4120,11 @@ packages: engines: {node: '>=10'} dev: true + /yargs-parser/21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + dev: true + /yargs/16.2.0: resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} engines: {node: '>=10'} @@ -4107,6 +4138,19 @@ packages: yargs-parser: 20.2.9 dev: true + /yargs/17.7.1: + resolution: {integrity: sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==} + engines: {node: '>=12'} + dependencies: + cliui: 8.0.1 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + dev: true + /yocto-queue/0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} diff --git a/src/class/HTMLMediaElementWithCaputreStream.ts b/src/class/HTMLMediaElementWithCaputreStream.ts index 7fd1a9e..c5ce1af 100644 --- a/src/class/HTMLMediaElementWithCaputreStream.ts +++ b/src/class/HTMLMediaElementWithCaputreStream.ts @@ -1,3 +1,3 @@ -interface HTMLMediaElementWithCaputreStream extends HTMLMediaElement { +export interface HTMLMediaElementWithCaputreStream extends HTMLMediaElement { captureStream(fps?: number): MediaStream; } diff --git a/src/component/ToolBar/BottomBar/parts/VideoShot.ts b/src/component/ToolBar/BottomBar/parts/VideoShot.ts index 682dbf4..1e4b96d 100644 --- a/src/component/ToolBar/BottomBar/parts/VideoShot.ts +++ b/src/component/ToolBar/BottomBar/parts/VideoShot.ts @@ -5,6 +5,7 @@ import { storeControlComponent } from "@/utils/store"; import { Toast } from "@/component/Toast/Toast"; import { confirmPath, countdownPath, videoShotPath$1 } from "@/svg/index"; import { Options } from "./Options"; +import { HTMLMediaElementWithCaputreStream } from "@/class/HTMLMediaElementWithCaputreStream"; export class VideoShot extends Options { readonly id = "VideoShot"; player: Player; diff --git a/tsconfig.json b/tsconfig.json index b865a70..d8cddc2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -37,7 +37,7 @@ "module": "ES6", /* Specify what module code is generated. */ // "rootDir": "./src", /* Specify the root folder within your source files. */ "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ - "baseUrl": ".", /* Specify the base directory to resolve non-relative module names. */ + "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ "paths": { "@/*": ["./src/*"] }, /* Specify a set of entries that re-map imports to additional lookup locations. */ @@ -55,7 +55,8 @@ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ /* Emit */ - "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationDir": "./dist/types", // "declarationMap": true, /* Create sourcemaps for d.ts files. */ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ "sourceMap": true, /* Create source map files for emitted JavaScript files. */