diff --git a/docs/assets/ts/artplayer-plugin-dash-control.d.ts b/docs/assets/ts/artplayer-plugin-dash-control.d.ts index 4aaa0fcf7..98bba5c2a 100644 --- a/docs/assets/ts/artplayer-plugin-dash-control.d.ts +++ b/docs/assets/ts/artplayer-plugin-dash-control.d.ts @@ -10,9 +10,9 @@ declare namespace artplayerPluginDashControlDefinitions { bitrateInKbit?: number } export interface AudioTrack { - id?: string | number - index?: number - lang?: string + id?: string | number | null + index?: number | null + lang?: string | null } export interface Config { control?: boolean diff --git a/packages/artplayer-plugin-dash-control/ARCHITECTURE.md b/packages/artplayer-plugin-dash-control/ARCHITECTURE.md index d2a37291b..dda76932d 100644 --- a/packages/artplayer-plugin-dash-control/ARCHITECTURE.md +++ b/packages/artplayer-plugin-dash-control/ARCHITECTURE.md @@ -73,6 +73,9 @@ the controlled error/identity tests. Changes to SDK capability detection belong `sdk.ts`, not in a global `any` or ambient module escape. Public `Config`, `Option`, `QualityLevel`, `AudioTrack`, and `Result` are named types. +AudioTrack id/index/lang include null as declared by both actual SDK generations; +internal AudioFields aliases that public shape. Nullable default labels preserve +runtime behavior, while caller formatters must still return strings. Default callbacks infer known SDK fields; explicit generic parameters or callback annotations accept a caller's more detailed SDK interfaces. Original object-based formatters remain valid. The optional overload supports omitted/undefined options; @@ -126,5 +129,9 @@ It also includes a native SDK control without an ArtPlayer instance. Early SDK 4 paused-seek stalls remain open; later passes do not resolve them. Unsupported MSE is recorded as a playback capability gap, not acceptance. This plugin currently refreshes on ready/restart/explicit update, not automatically on external SDK events. +`refactor/scripts/dash-sdk-types.test.mjs` compares actual SDK-only and plugin +consumers across ten compiler/module configurations, retaining upstream-only +Node10/old DOM diagnostics. The exact peer dependency closure is hash-pinned in +`refactor/baselines/dash-type-dependencies.json`; no type shim or paths mapping is used. See [refactor validation](../../refactor/dash-validation.md) for baseline failures and [task plan](../../refactor/plan.md) for remaining type and release work. diff --git a/packages/artplayer-plugin-dash-control/README.md b/packages/artplayer-plugin-dash-control/README.md index 48f8175cb..e90104cd2 100644 --- a/packages/artplayer-plugin-dash-control/README.md +++ b/packages/artplayer-plugin-dash-control/README.md @@ -6,6 +6,27 @@ Accepts a caller-owned dash.js instance at `art.dash`. Quality selection adapts dash.js 4.x quality methods or 5.x representation methods. Version 5 selection uses representation IDs so bitrate filtering does not change the selected quality. +## TypeScript + +The formatter receives the original SDK object. For dash.js 5.2.1 types: + +```ts +import type { MediaInfo, Representation } from 'dashjs' +import dashControl from 'artplayer-plugin-dash-control' + +dashControl({ + quality: { getName: level => `${level.height}p` }, + audio: { getName: track => track.lang || String(track.id) }, +}) +``` + +dash.js 4.5.2 uses `BitrateInfo` for quality instead of `Representation`. Audio +metadata `id`, `index`, and `lang` may be null; custom formatters must return strings. +The original object-based formatters and synchronous `update()` remain supported. +Actual 5.2.1 SDK types resolve with TypeScript 5.9.3 NodeNext/Bundler in our matrix; +Node10 resolution and TypeScript 4.3.5 have upstream SDK declaration limitations. +See the [tested type matrix](../../refactor/changes/2026-09-12-PKG-DASH-05-sdk-types.md). + ## Demo [https://artplayer.org](https://artplayer.org/?libs=https://cdnjs.cloudflare.com/ajax/libs/dashjs/5.2.1/modern/umd/dash.all.min.js%0A./uncompiled/artplayer-plugin-dash-control/index.js&example=dash.control) diff --git a/packages/artplayer-plugin-dash-control/src/types.ts b/packages/artplayer-plugin-dash-control/src/types.ts index 7e73ec882..76aef92a7 100644 --- a/packages/artplayer-plugin-dash-control/src/types.ts +++ b/packages/artplayer-plugin-dash-control/src/types.ts @@ -1,6 +1,6 @@ -import type { Config } from '../types/artplayer-plugin-dash-control' +import type { AudioTrack, Config } from '../types/artplayer-plugin-dash-control' -export type Label = string | number | undefined +export type Label = string | number | null | undefined export type Identifier = string | number export type Valid = () => boolean export type Cleanup = () => void @@ -12,11 +12,7 @@ export interface QualityFields { qualityIndex?: number } -export interface AudioFields { - id?: Identifier - index?: number - lang?: string -} +export type AudioFields = AudioTrack export interface Dash { getVideoElement: () => object | null diff --git a/packages/artplayer-plugin-dash-control/types/artplayer-plugin-dash-control.d.ts b/packages/artplayer-plugin-dash-control/types/artplayer-plugin-dash-control.d.ts index 832a1b35a..d17c250cf 100644 --- a/packages/artplayer-plugin-dash-control/types/artplayer-plugin-dash-control.d.ts +++ b/packages/artplayer-plugin-dash-control/types/artplayer-plugin-dash-control.d.ts @@ -10,9 +10,9 @@ export interface QualityLevel { } export interface AudioTrack { - id?: string | number - index?: number - lang?: string + id?: string | number | null + index?: number | null + lang?: string | null } export interface Config { diff --git a/refactor/baselines/dash-sdk-type-diagnostics.json b/refactor/baselines/dash-sdk-type-diagnostics.json new file mode 100644 index 000000000..ed54b6b7c --- /dev/null +++ b/refactor/baselines/dash-sdk-type-diagnostics.json @@ -0,0 +1,149 @@ +{ + "schemaVersion": 1, + "task": "PKG-DASH-05", + "note": "Reviewed SDK-only baseline, not a waiver of declaration errors. Modern SDK 5 consumers require export-aware resolution; TS 4.3 also lacks FontFace. Plugin consumers must add no diagnostics; invalid usages must add the expected two.", + "matrix": [ + { + "sdk": "4.5.2", + "compiler": "5.9.3", + "mode": "node10-commonjs", + "sdkOnly": { + "diagnostics": [], + "files": [ + "node_modules/dashjs/index.d.ts" + ] + } + }, + { + "sdk": "4.5.2", + "compiler": "5.9.3", + "mode": "nodenext-cjs", + "sdkOnly": { + "diagnostics": [], + "files": [ + "node_modules/dashjs/index.d.ts" + ] + } + }, + { + "sdk": "4.5.2", + "compiler": "5.9.3", + "mode": "nodenext-esm", + "sdkOnly": { + "diagnostics": [], + "files": [ + "node_modules/dashjs/index.d.ts" + ] + } + }, + { + "sdk": "4.5.2", + "compiler": "5.9.3", + "mode": "bundler-esm", + "sdkOnly": { + "diagnostics": [], + "files": [ + "node_modules/dashjs/index.d.ts" + ] + } + }, + { + "sdk": "4.5.2", + "compiler": "4.3.5", + "mode": "node10-commonjs", + "sdkOnly": { + "diagnostics": [], + "files": [ + "node_modules/dashjs/index.d.ts" + ] + } + }, + { + "sdk": "5.2.1", + "compiler": "5.9.3", + "mode": "node10-commonjs", + "sdkOnly": { + "diagnostics": [ + { + "file": "node_modules/dashjs/index.d.ts", + "code": 2307, + "line": 6, + "message": "Cannot find module '@svta/cml-request' or its corresponding type declarations.\n There are types at '/node_modules/@svta/cml-request/dist/index.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'." + } + ], + "files": [ + "node_modules/dashjs/index.d.ts" + ] + } + }, + { + "sdk": "5.2.1", + "compiler": "5.9.3", + "mode": "nodenext-cjs", + "sdkOnly": { + "diagnostics": [], + "files": [ + "node_modules/@svta/cml-utils/dist/index.d.ts", + "node_modules/@svta/cml-structured-field-values/dist/index.d.ts", + "node_modules/@svta/cml-cmcd/dist/index.d.ts", + "node_modules/@svta/cml-request/dist/index.d.ts", + "node_modules/dashjs/index.d.ts" + ] + } + }, + { + "sdk": "5.2.1", + "compiler": "5.9.3", + "mode": "nodenext-esm", + "sdkOnly": { + "diagnostics": [], + "files": [ + "node_modules/@svta/cml-utils/dist/index.d.ts", + "node_modules/@svta/cml-structured-field-values/dist/index.d.ts", + "node_modules/@svta/cml-cmcd/dist/index.d.ts", + "node_modules/@svta/cml-request/dist/index.d.ts", + "node_modules/dashjs/index.d.ts" + ] + } + }, + { + "sdk": "5.2.1", + "compiler": "5.9.3", + "mode": "bundler-esm", + "sdkOnly": { + "diagnostics": [], + "files": [ + "node_modules/@svta/cml-utils/dist/index.d.ts", + "node_modules/@svta/cml-structured-field-values/dist/index.d.ts", + "node_modules/@svta/cml-cmcd/dist/index.d.ts", + "node_modules/@svta/cml-request/dist/index.d.ts", + "node_modules/dashjs/index.d.ts" + ] + } + }, + { + "sdk": "5.2.1", + "compiler": "4.3.5", + "mode": "node10-commonjs", + "sdkOnly": { + "diagnostics": [ + { + "file": "node_modules/dashjs/index.d.ts", + "code": 2307, + "line": 6, + "message": "Cannot find module '@svta/cml-request' or its corresponding type declarations." + }, + { + "file": "node_modules/dashjs/index.d.ts", + "code": 2304, + "line": 5067, + "message": "Cannot find name 'FontFace'." + } + ], + "files": [ + "node_modules/dashjs/index.d.ts" + ] + } + } + ] +} diff --git a/refactor/baselines/dash-sdk-types-validation.json b/refactor/baselines/dash-sdk-types-validation.json new file mode 100644 index 000000000..527393f13 --- /dev/null +++ b/refactor/baselines/dash-sdk-types-validation.json @@ -0,0 +1,685 @@ +{ + "schemaVersion": 1, + "task": "PKG-DASH-05", + "sourceCommit": "c4b5f5f4", + "status": "doing", + "scope": "Actual SDK declaration projection, nullable metadata, source/artifact regression, generated Monaco types and isolated plugin tarball types. No new runtime media acceptance.", + "inputs": [ + { + "file": "packages/artplayer-plugin-dash-control/src/types.ts", + "sha256LF": "4a2c6b17159a01b674fb9bd7b55f27695156918be7e19d6c71b30ea16232d2a4" + }, + { + "file": "packages/artplayer-plugin-dash-control/types/artplayer-plugin-dash-control.d.ts", + "sha256LF": "ca279baa3c3020b570c76f3060fb591d3b7822c603ebb872ccd99a30af8a6a72" + }, + { + "file": "docs/assets/ts/artplayer-plugin-dash-control.d.ts", + "sha256LF": "c7e3c83f3377b615e503a270af12915dcc82fe3f2cfabdae396632855a27f73f" + }, + { + "file": "test/types/dash-control.ts", + "sha256LF": "4046e5b2b40d15c4a75c53730c38570e0f7dee08a932a22c60a0dc1aa1f603a7" + }, + { + "file": "test/dash-lifecycle.test.js", + "sha256LF": "bc65b93b6a5a2f5e5ad9ffd7a467914bdc891af528dd135a96545b1cd6fc2bcb" + }, + { + "file": "test/browser/dash-editor-types.spec.js", + "sha256LF": "6a71ce1c1d0569347b5ac212ccccf14ae7eabce64ec6de3e75dc4d30d8c151a0" + }, + { + "file": "refactor/scripts/dash-sdk-types.mjs", + "sha256LF": "85a500ba1cbba1ec8c12d83c1bed66f08a86f8e23f2a06faabe982f81323c8bb" + }, + { + "file": "refactor/scripts/dash-sdk-types.test.mjs", + "sha256LF": "a7e618b8e5c6cb2ab896a61efaa9e8f20f32ac563dd97048fb2a7705600d80ad" + }, + { + "file": "refactor/scripts/releases.mjs", + "sha256LF": "ff06a7f9902919dff8f5718d9929cfedfdd0383d41cbd7dcc2a981587bfd628e" + }, + { + "file": "refactor/scripts/releases.test.mjs", + "sha256LF": "51a6d112cd16521b77d521878b0ded27bfcce3028f94942bc495d6a3a31ab76b" + }, + { + "file": "refactor/scripts/dash-package-types.mjs", + "sha256LF": "a3dde71af00a7b99793994107bc5930219ecfea63fd01a743d8e7bd235cc9cd7" + }, + { + "file": "refactor/baselines/dash-type-dependencies.json", + "sha256LF": "049a514ed4be25789c1381ae7b36417353b0eb822802a8ae82b1fd520fce5a9b" + }, + { + "file": "refactor/baselines/dash-sdk-type-diagnostics.json", + "sha256LF": "cd00d50f823535e2a148af73155467734f401ef791d802d3546c852eeb2b60cb" + }, + { + "file": "refactor/fixtures/consumers/dash-sdk-v4.ts", + "sha256LF": "d866dcc32319540ee9e2b70dfb2839da3bf13da8c1c35345de943a29e1af6d5c" + }, + { + "file": "refactor/fixtures/consumers/dash-sdk-v5.ts", + "sha256LF": "aca55f822a2ac454528e5bdd1f18eeeebe09a8ac3b192dcce7bc85500814c712" + } + ], + "artifacts": [ + { + "file": "packages/artplayer-plugin-dash-control/dist/artplayer-plugin-dash-control.js", + "sha256": "9ae800d1e8b3179d5c89baa567b5990cc1e9abd1b9d1cc6ee5c67a8e74e764fd", + "bytes": 5489, + "unchangedFrom": "PKG-DASH-04" + }, + { + "file": "packages/artplayer-plugin-dash-control/dist/artplayer-plugin-dash-control.legacy.js", + "sha256": "59e6545eabdf8f60e6897494de4faa472406ea8062eff2bdeb0ec2f17491aa49", + "bytes": 5944, + "unchangedFrom": "PKG-DASH-04" + }, + { + "file": "packages/artplayer-plugin-dash-control/dist/artplayer-plugin-dash-control.mjs", + "sha256": "42538d13a39d219ba2fbf7f2812440b6096dd7a143e20e4ec1d2cbcdd7a308ab", + "bytes": 9807, + "unchangedFrom": "PKG-DASH-04" + } + ], + "matrix": [ + { + "sdk": "4.5.2", + "compiler": "5.9.3", + "mode": "node10-commonjs", + "upstreamDiagnostics": 0, + "addedByPlugin": 0, + "rejectedInvalidCalls": 2 + }, + { + "sdk": "4.5.2", + "compiler": "5.9.3", + "mode": "nodenext-cjs", + "upstreamDiagnostics": 0, + "addedByPlugin": 0, + "rejectedInvalidCalls": 2 + }, + { + "sdk": "4.5.2", + "compiler": "5.9.3", + "mode": "nodenext-esm", + "upstreamDiagnostics": 0, + "addedByPlugin": 0, + "rejectedInvalidCalls": 2 + }, + { + "sdk": "4.5.2", + "compiler": "5.9.3", + "mode": "bundler-esm", + "upstreamDiagnostics": 0, + "addedByPlugin": 0, + "rejectedInvalidCalls": 2 + }, + { + "sdk": "4.5.2", + "compiler": "4.3.5", + "mode": "node10-commonjs", + "upstreamDiagnostics": 0, + "addedByPlugin": 0, + "rejectedInvalidCalls": 2 + }, + { + "sdk": "5.2.1", + "compiler": "5.9.3", + "mode": "node10-commonjs", + "upstreamDiagnostics": 1, + "addedByPlugin": 0, + "rejectedInvalidCalls": 2 + }, + { + "sdk": "5.2.1", + "compiler": "5.9.3", + "mode": "nodenext-cjs", + "upstreamDiagnostics": 0, + "addedByPlugin": 0, + "rejectedInvalidCalls": 2 + }, + { + "sdk": "5.2.1", + "compiler": "5.9.3", + "mode": "nodenext-esm", + "upstreamDiagnostics": 0, + "addedByPlugin": 0, + "rejectedInvalidCalls": 2 + }, + { + "sdk": "5.2.1", + "compiler": "5.9.3", + "mode": "bundler-esm", + "upstreamDiagnostics": 0, + "addedByPlugin": 0, + "rejectedInvalidCalls": 2 + }, + { + "sdk": "5.2.1", + "compiler": "4.3.5", + "mode": "node10-commonjs", + "upstreamDiagnostics": 2, + "addedByPlugin": 0, + "rejectedInvalidCalls": 2 + } + ], + "counts": { + "sourceNode": 118, + "threeFormatNode": 274, + "editorBrowser": { + "passed": 3, + "skipped": 0, + "failed": 0, + "retries": 0 + }, + "isolatedTypeModes": 5, + "isolatedInvalidCallsPerMode": 8 + }, + "evidence": [ + { + "file": "refactor/.cache/dash-sdk-type-diagnostics-first.json", + "sha256": "3122f6cdccc5da9e5e921517bd6684743cab276b85d617f4dc157b0770d52eef", + "bytes": 34948 + }, + { + "file": "refactor/.cache/dash-sdk-type-diagnostics-nullable-before.json", + "sha256": "50b17cec109202850a783b8ae3169737cfa6448b68da227bbcc7aaf42306422f", + "bytes": 25932 + }, + { + "file": "refactor/.cache/dash-sdk-type-diagnostics.json", + "sha256": "e6b338b0ae6dd3dad807ea1b431f508c389637946916a0fd189e213a574610f8", + "bytes": 18224 + }, + { + "file": "refactor/.cache/dash05-types-first.log", + "sha256": "54966465da8d7f34b31c57e740c1fc8f6949bd83d35953ecc33f85505a26003d", + "bytes": 1413 + }, + { + "file": "refactor/.cache/dash05-types-nullable-before.log", + "sha256": "54966465da8d7f34b31c57e740c1fc8f6949bd83d35953ecc33f85505a26003d", + "bytes": 1413 + }, + { + "file": "refactor/.cache/dash05-types-nullable-after.log", + "sha256": "46995170af10ef7fed12fe01c30be36757061bd8583d70e6b06bd9030c0b2125", + "bytes": 1413 + }, + { + "file": "refactor/.cache/dash05-sdk-types-test.log", + "sha256": "c4cc0717b02cb77b66659e34ce7706c1b999e3cf2c27f865103e6927ed3e92df", + "bytes": 226 + }, + { + "file": "refactor/.cache/dash05-sdk-types-test-final.log", + "sha256": "47d2dc9e3f4906574e3b358cd43ae8f10c6e9fadaf91317e9a21aff2ba438f99", + "bytes": 225 + }, + { + "file": "refactor/.cache/dash05-types-node.log", + "sha256": "3e5df29fa9d4f152d65e49c87e2cf1b11740aff74927b6994506ea7fa290cfb6", + "bytes": 12098 + }, + { + "file": "refactor/.cache/dash05-nullable-artifacts.log", + "sha256": "14185c8bc2de4126ede56517469c38e1b93349014640a0b82d4790686d1ddfc4", + "bytes": 33195 + }, + { + "file": "refactor/.cache/dash05-nullable-editor.log", + "sha256": "b702507dfe6a9191db98af4da024f3f0a08eea86384f95f827a8c89070e67240", + "bytes": 1603 + }, + { + "file": "refactor/.cache/dash05-nullable-package.log", + "sha256": "a20044dedac1601ccf515dde3d48b03df08efd8285c65a2f3b01914d20da637e", + "bytes": 630 + }, + { + "file": "refactor/.cache/dash05-nullable-package-final.log", + "sha256": "32d73b54f5346f82f8da82a77a5aaea5d5d3659b217ae7648a0ac108f09279ea", + "bytes": 629 + }, + { + "file": "refactor/.cache/dash05-nullable-build-final.log", + "sha256": "1ba77e618771e9775929eccfdccd397819959ee71c333ad5782b9af897908a42", + "bytes": 1472 + }, + { + "file": "refactor/.cache/dash05-nullable-ci-setup-failure.log", + "sha256": "fa65c8f8da5448084b6a3efb04a3bb7c2fb14dd0adedde5d6b4a69b0b7d9bb3a", + "bytes": 2165 + }, + { + "file": "refactor/.cache/dash05-nullable-editor/report.json", + "sha256": "95db2386af3f55c215816b98725541893d277bfde9a70b9668eb079ca92ec1c5", + "bytes": 32083 + }, + { + "file": "refactor/.cache/dash05-nullable-editor/results/.last-run.json", + "sha256": "91d1c43004802cd49950d78eb11c8fa7d05da8ffffe219a8b13b2f561bc00903", + "bytes": 45 + }, + { + "file": "refactor/.cache/dash05-nullable-editor/results/dash-editor-types-Monaco-c-d2da4--the-emitted-plugin-factory-chromium/trace.zip", + "sha256": "0696c9203801f364f56fbeb1fffabcf6c83e38bd5f36b0a966b325769286fadb", + "bytes": 1057639 + }, + { + "file": "refactor/.cache/dash05-nullable-editor/results/dash-editor-types-Monaco-c-d2da4--the-emitted-plugin-factory-firefox/trace.zip", + "sha256": "8d7691f7f886374a38e361de13cef9baaf8a94069ac0f0d481f6d8ffd307596d", + "bytes": 1085278 + }, + { + "file": "refactor/.cache/dash05-nullable-editor/results/dash-editor-types-Monaco-c-d2da4--the-emitted-plugin-factory-webkit/trace.zip", + "sha256": "8e91b9f800091fa6d9722890e77e751794be2ed35c9ee4b51dfc72afab0ba296", + "bytes": 1119035 + } + ], + "remaining": [ + "DASH-SEEK-01", + "automatic SDK state refresh/error/lifecycle", + "legacy actual SDK media", + "effective MSE/device coverage", + "8082 demo and full installed runtime distribution" + ], + "packageTypes": { + "directory": "D:\\github\\ArtPlayer\\refactor\\.cache\\dash-package-types-3hk1W5", + "report": { + "suite": "dash-isolated-package-types", + "introducedBy": "PKG-DASH-04", + "scope": "Packed current core and DASH, offline Yarn install and frozen reinstall outside workspace; isolated public type acceptance only, not complete package runtime/SDK/media release validation.", + "packages": [ + { + "name": "artplayer", + "archive": "D:\\github\\ArtPlayer\\refactor\\.cache\\dash-package-types-3hk1W5\\artplayer.tgz", + "sha256": "2139af017670a4f30f667bf5fdc1aa680f3e03b9c8d3cb767fc92d6345aedff5", + "files": { + "package/ARCHITECTURE.md": "7ebedaee4d06925e0f7bf2ad4a2e6093aa416c91ea4d6154015854baf507e95e", + "package/README.md": "1e185e65f67fc2081b4182bbc6c4558ea05b6e3fa3acc5dd0c3ac7df1d542b09", + "package/THIRD_PARTY_NOTICES": "b77b5b46b79fa0cda850b0781f78c3b1112c4ed9672fa291956fe8eff53098e7", + "package/dist/artplayer.cts": "0e91e907d021db02a68004603e6190505fdc0806d873ebb6af171aa089a81da7", + "package/dist/artplayer.js": "dc1460b77abdd401158e098b25a1abf280c53bb92d401fc387a4864dc7b18357", + "package/dist/artplayer.legacy.js": "49781a25f3d680c7964eec066b792966da71f03ccc3e7936cd5e0e9563e83008", + "package/dist/artplayer.mjs": "ad4e69b1a7a9584ab79204b871f51f4ae6561dc2dece2c64fa9c4884acd36154", + "package/dist/artplayer.mts": "f6292596a9ccb1d43a6d6a12c35f859b1889ad15924c5ae0f9f280941aade313", + "package/dist/artplayer.ts": "26a42ac66811e70f68a8ebe62cbf304eb1993451b3e658961be98e7106162527", + "package/dist/component.ts": "aa1c43be67322781b4b355b143bc69d9f29d22e578e4974d6a13e957a7c0334f", + "package/dist/config.ts": "c4fd8681bf32b10c743e3e561c532520c8f32e43fd765524850b15e55cb91c72", + "package/dist/cssVar.ts": "e027d82fb4f01c9ce7559cf679b2d5ee1962d3f7e5b4dd64ca21f472b933efb6", + "package/dist/emitter.ts": "9c62551cdcc6dd3966bed8a7a85dd477435db977c91a294d2ac8f162f9592537", + "package/dist/events.ts": "af191f862af4ec8933b09113b8c074603ae254a8b70460d0f3006646cd74ae42", + "package/dist/i18n.ts": "34b0c684668044f7600c80b9d3979f8fb730138007b7cb4e7034326b340156fb", + "package/dist/i18n/ar.js": "bd0bef65f4f7dc3f8ed562904cc6fa9071ff4537fb64c1e0fc3d554141bcd3cb", + "package/dist/i18n/ar.mjs": "59310b7bbeea83bbb7d73aadc5ca82a6ec269c3530d19aa741c94d5c64fc5da8", + "package/dist/i18n/cs.js": "6e2c93daba24c2e48dfa206bcf4f2f2a8a02713b856e404d2e4e4ecd8309ca2f", + "package/dist/i18n/cs.mjs": "c73fba18797d62d7b2581e67fe7340c35fe84510b2250ff1ecaad253d9cabbac", + "package/dist/i18n/es.js": "f4133ac6ea06b69a474b33c4a1809a4066e2376bb9464a3f3aa8330f01f1944a", + "package/dist/i18n/es.mjs": "1390bca3def2be115e811de337df0a0c3f63998e51359f283023246245c552a7", + "package/dist/i18n/fa.js": "8d3ef2e0f0cc0ea480c2167b6fcb87cdf444e90759c3519e8daa139fec576da4", + "package/dist/i18n/fa.mjs": "ab441e8a2d79043b29ceca87c783bf06874bb9d3a149c1604bc167eb481be2a9", + "package/dist/i18n/fr.js": "89dc4194a6c0a962b9ce756b52c90401c1acf3b159f265f3bc0d7d6d7d987f03", + "package/dist/i18n/fr.mjs": "99491878430fb7b6f2b7bf93da0588a831704b412e01116f23ba1d9d45863816", + "package/dist/i18n/id.js": "4c6dc86db741bcc2857df55a9d037e82e91d375fa6fd22e0562809ff621b92db", + "package/dist/i18n/id.mjs": "383e5803a6b6686c6de4e867770241de75b6f517dcca2bdedc6f2004bf6e1fb3", + "package/dist/i18n/pl.js": "3a38828b1c3d719c0aca9906cf6a46c23555a8411f8d57645f0e0ce8147dc664", + "package/dist/i18n/pl.mjs": "079ed96732979035297af387c64a7b99519b5a43107fb86735a654ea4fe8e9b5", + "package/dist/i18n/ru.js": "62fac9dddb302eb16382e6e9301fc4b2c66f5f69d4a358a26b67026a5fa4e787", + "package/dist/i18n/ru.mjs": "a893aeaee1d79409db72e324fbff200e3864f33ed168f04d91d25f7cf2efa765", + "package/dist/i18n/tr.js": "1492c36b069a7d73db4f3913bd18085faff7afd8b3c158138fe264e31600e38c", + "package/dist/i18n/tr.mjs": "a90478cac078836b76c2a98261907610fee07f3e4b28671b8e7dbf533778f918", + "package/dist/i18n/vi.js": "c7216ef7e608a79b7e2c479a07bf310d4ab79577947ac4a62d676faaced0e9cf", + "package/dist/i18n/vi.mjs": "66270fdfa0b5da396322d1769169b7df37a030ba15ac18eb30bd87b3af8074ec", + "package/dist/i18n/zh-tw.js": "11c49857d6d40a5ffd224ffa59c9026e71621b345f63c5a086326db80a22371a", + "package/dist/i18n/zh-tw.mjs": "a38e630cb96de96c15d824686aec750e25cf6c8ada01285a292442a81566314f", + "package/dist/icons.ts": "0d8e8e52e52130dd4a29bab551dd7a2a954797e42e92a6e068c85d583e23e6a4", + "package/dist/language.cts": "2248040d86a8e34626755c4ecf53ea0174706c653073cf0e15884a030d173120", + "package/dist/language.mts": "c391e863012c77769e661afbf8fa949e9373aa88d17f58cbba7f5696edb8077f", + "package/dist/legacy/language.ts": "c452ffd764ff9b29b819b3475c42395d2ea7a33560d8c186ef5df3844b9524c3", + "package/dist/option.ts": "850e5264219b8b438c80694402225b690b131786677a5da0d22739ec2352d263", + "package/dist/playback.ts": "1ceaed3aa1cef511fe8b20f4874647f6065c723ad805b742a0a9247e16bb1bb5", + "package/dist/player.ts": "f1e50257df2ea592d0a0e1f36078dda77eaf2cf3b3d795307501396562d99f28", + "package/dist/plugin.ts": "2a57e148fda00ee687da5036b890b0f611cb94bb403a1ed52602179060259d35", + "package/dist/quality.ts": "7ed6ed78cea52991b2f6ddd2bd3b7bd8c5146fdfff7486fe8b814c3e632f1567", + "package/dist/runtime.cts": "52cfff1daeb6841a90212c8fa8d46ca46d6650bb7ed1b59b62115d854b8ad652", + "package/dist/runtime.mts": "1b09bc0ee0f0ee2f788689eaff441bdeda1fab0ce783e71b61b9792d81072b03", + "package/dist/runtime.ts": "ec4b1d56993eb482a77eb0f94b701047549d009e6ba6433f27e7d464fef30c2b", + "package/dist/runtime/component.ts": "840213299c942fe058eb5436977ceec066b9dccda24c55ae9f464b399c979e39", + "package/dist/runtime/construction.ts": "24cc5cda1f614314db382271a9b0d5583b781894cfdf6c548700b1b5270467ee", + "package/dist/runtime/events.ts": "52848f57d35eb1037cf74c8877521edf99a015bcd77f30ef6bbcba1807a99bfe", + "package/dist/runtime/media.ts": "8828f80953aec3e95328cefe691661e8897cb27cb309483cf806ec45a8549ae3", + "package/dist/runtime/option.ts": "bb672e49ffe74a6fc78543217f6de80d7d738890146df0857c709d4dc283e4ce", + "package/dist/runtime/player.ts": "a4a24794e26cfb9e4310bf0f459a7a407e85bf81b4f3a4feb6294331af8036fb", + "package/dist/runtime/plugin.ts": "9ad482f2a77914a91450419680b8af6b314b926f0831c2f7f6d7c466690f95c9", + "package/dist/runtime/services.ts": "8e4648d8c61bff47343f9e1c2b995af69fc00947264b826109ceadcbaf553254", + "package/dist/runtime/setting.ts": "c48d20957b57f79f985ef76a2950cc8a5cfa25dafa8ec5939e562661778e6218", + "package/dist/runtime/subtitle.ts": "13241c4f9a87517aa2cf7b3e0bb8cedaa12fa0b4d3f8934285797583b752557e", + "package/dist/runtime/template.ts": "da9975513a1938e7f386f4f65f718f0fc595164bfeac8f0cd99a3e97a54919a1", + "package/dist/runtime/utils.ts": "cab9916f5224a3b047812b9f759cc9cc62105662599744067a6955020ab36916", + "package/dist/setting.ts": "d12a75b656fff70cbb30be4bffec46d9c4273636e8722bce971a4d2b188712a1", + "package/dist/subtitle.ts": "d25b470e47d6a9bd696d9c1ad8adb58e56a208f05695186d513bc8c43c2e8acf", + "package/dist/template.ts": "68aed9e97d006d6be4fabb8504ca84dafab770b0925f4d6e7319e67c82f21b0d", + "package/dist/utils.ts": "494ec447ab467a07ddd7a2c2abf778b3fce69fd28a09aaa8ced9759f8de2e3f6", + "package/package.json": "82e92699e7c29847f32ac6767ece0401290e7d7a12854722bdbcfd09b90b7954", + "package/types/COMPATIBILITY.md": "a7da9e102a116104b513df4f7451247b7759bc502d3375f30bd5b14a541826e0", + "package/types/README.md": "1bd9868e773610e6312fd48a1c5aa20772d29df0af40c3db66e75b7ab4a1aee0", + "package/types/artplayer.d.cts": "3685065e4263abcfd9d953176e461d5b3eb990b0363b54689a7f55deba770fef", + "package/types/artplayer.d.mts": "b664fec51ee5c5381f2ceab25d99d52aee56feab04a2ee7b4ea5b2145ea5fa0e", + "package/types/artplayer.d.ts": "5d0162adf7ac6d0f2bb9b5cfe361f28657c4d9c540cadbf36eba3cc954ce50f8", + "package/types/component.d.ts": "ae5bc1ddeaa1ee1ebbc62573e32423993727079205c64751a5a314170e588a32", + "package/types/config.d.ts": "36f9a84cd436f17701a0d11d3417fc1fe0414e0c52c80083b94a85dfc329e37e", + "package/types/cssVar.d.ts": "93217860fff2ebf750f606d95ddd22220a58837119e63bdf2f5f78fd7488458b", + "package/types/emitter.d.ts": "7e1f9a2a8ce65feb95734f1ed52d1334e57aa388bbef2a43d8bc53a9b6f6623c", + "package/types/events.d.ts": "f83624c9268a284477e8bd793fe3562a2363b72f2a44d5c64fe8c6a6cede8830", + "package/types/i18n.d.ts": "f4f2f05bdfda73c74fef34767cb18ee8e11b743120b1c4598e9714d7846018e5", + "package/types/icons.d.ts": "326a67ba7bdcf52862c5b2a269e540140aff98d05c7b96196485a77f84fe5960", + "package/types/language.d.cts": "f7928e108cf7b7814c2d75cb0a525333e95873fca6cd6d89a740450656b9c1cd", + "package/types/language.d.mts": "6619a26d604b7cccbe2f596243d87ae37cfaae33b8b52874ec071d9787446f9e", + "package/types/legacy/language.d.ts": "c7abda4d506fd933c350e9030290bf9e64347a921d683a66115da1995ebe0a81", + "package/types/option.d.ts": "ccf2c8ddc537dc65c9682d39f044726e23bff18f476b622512d7e6a4b949b5f6", + "package/types/playback.d.ts": "58705c273df6e76a77a6575e769a9ec6c013785c25080f2551aa22415788d870", + "package/types/player.d.ts": "92b00211b70ac71336e495899df972a0519dd138111846044fe4e0f967966177", + "package/types/plugin.d.ts": "fc3594a41c51d8248713e33c486fb1f6a518ac5c7ce31be6988a6cd8d052c5f3", + "package/types/quality.d.ts": "1ac1a48b4f74ff9ba1ce60443e1463d50d1c6a2e5d87d63dc7d2a8eb7f4c2c34", + "package/types/runtime.d.cts": "7ee988dfea9a0ac71a34a656f96f7b74e78aa92547cfdfab7ff7e1139a77d4a3", + "package/types/runtime.d.mts": "dcb85f59a8b7714918ced0c1d18c2bb24e8b80b56d8c594e019dcbdb5ad88b08", + "package/types/runtime.d.ts": "9c6ccd39a1be293f17ae46dae8ea077053e12635ee79d73a5e3b3a559230fcff", + "package/types/runtime/component.d.ts": "1b4c0cee44568649e80140fe778febfcae88af0ac85515f1cbeff78ab0c6d14f", + "package/types/runtime/construction.d.ts": "7a87bedf6f7ffff0c46078aa5f1551e0077d35574e286516121f5f935e2d9ce4", + "package/types/runtime/events.d.ts": "a1e2f9d387475453eaf95c2a5ee79e228636c0bb859bda3fcc46da46574a0c31", + "package/types/runtime/media.d.ts": "8fc89401be7fe25542c169d07dd5675f10916ed20be8493e19695966cf3864a8", + "package/types/runtime/option.d.ts": "6e334e1a76fdcc40b4665c02523bd31c3994d96078fadeb40e23422aa54c1a1d", + "package/types/runtime/player.d.ts": "8ac6383502e4872e83659838844856903031a81a0adc8e8535feb78453aa042c", + "package/types/runtime/plugin.d.ts": "8528f2b17843149f42f9cc16d6fd70baa238c9dc2c329b67d2c38096799c69bd", + "package/types/runtime/services.d.ts": "604c9f8e4b6c0da818f96576bf9f4b0e96085a9003927b2f7ba30027b1ba237e", + "package/types/runtime/setting.d.ts": "349c1fcb205ad312916bd3ee55e6bf241ea8a569fb2ab6c80822e69fc518f7d7", + "package/types/runtime/subtitle.d.ts": "269ff84678d327b3a9dc2f5bc6cc0d731d1e081b85422e474621d5d792efb153", + "package/types/runtime/template.d.ts": "7a62f968a38b4bf9109a4439557c02074eb1d62ba1f6e21a8eb194e91f0badfe", + "package/types/runtime/utils.d.ts": "6bf731705d86853e066dbaf3b8d4003b6548423fe615b7412b722bd0d3a6e48b", + "package/types/setting.d.ts": "08305a75dff96f06490430e099338b463df471b550c1d0dac3abc8995b39eb09", + "package/types/subtitle.d.ts": "b18314e2d64efdb6045830b6e12f615ae2ed585416130e562329ad3ea337f6ce", + "package/types/template.d.ts": "4792bc0c2cbcb7966e4375118bd34b326166e0831862e94ace4cf6b1bbe6a8c8", + "package/types/utils.d.ts": "fca0d3d814df94a25f9eb067c86fa0cf272e2791bac793b91229d57680797712" + } + }, + { + "name": "artplayer-plugin-dash-control", + "archive": "D:\\github\\ArtPlayer\\refactor\\.cache\\dash-package-types-3hk1W5\\artplayer-plugin-dash-control.tgz", + "sha256": "3d2cb1162ca1d2a74b6bb1ec2d134d8955921896b28a311b289d6601901374cd", + "files": { + "package/ARCHITECTURE.md": "9e85fe46d34b69b957cad9468f078bfbbc2ba5711d059e6e5f2d9b988171f3ac", + "package/README.md": "c4b09e45e7afa1751c637965c89f362159aff7bce7f0e5e83a1f4c51cc3c5e30", + "package/dist/artplayer-plugin-dash-control.js": "9ae800d1e8b3179d5c89baa567b5990cc1e9abd1b9d1cc6ee5c67a8e74e764fd", + "package/dist/artplayer-plugin-dash-control.legacy.js": "59e6545eabdf8f60e6897494de4faa472406ea8062eff2bdeb0ec2f17491aa49", + "package/dist/artplayer-plugin-dash-control.mjs": "42538d13a39d219ba2fbf7f2812440b6096dd7a143e20e4ec1d2cbcdd7a308ab", + "package/package.json": "0757055e9d84e95a3fe2278b86aefad75ddf6e3a902a2e010645f82d9936a158", + "package/types/artplayer-plugin-dash-control.d.cts": "20cbbeed90e0cd7d7b536b945dd01f31679e4325854aa36b732cb8e6ccc70d02", + "package/types/artplayer-plugin-dash-control.d.mts": "f52ae616c501be0685a14cb4e48252c88a67c9d4b0a9c1138921de89521f6b81", + "package/types/artplayer-plugin-dash-control.d.ts": "8470943bc5f2461f8b5d7420c0fd53828279c5dd8804c044f4c3b516f433506d" + } + } + ], + "matrix": [ + { + "compiler": "5.9.3", + "mode": "node10-commonjs", + "diagnostics": [], + "invalid": [ + { + "code": 2322, + "message": "Type 'void' is not assignable to type 'Promise'." + }, + { + "code": 2554, + "message": "Expected 0 arguments, but got 1." + }, + { + "code": 2322, + "message": "Type '\"dash\"' is not assignable to type '\"artplayerPluginDashControl\"'." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Type '(value: QualityLevel, index: number) => string' is not assignable to type '(item: QualityLevel) => string'.\n Target signature provides too few arguments. Expected 2 or more, but got 1.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Type '(value: QualityLevel, index: number) => string' is not assignable to type '(item: QualityLevel) => string'.\n Target signature provides too few arguments. Expected 2 or more, but got 1." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Type '() => number' is not assignable to type '(item: AudioTrack) => string'.\n Type 'number' is not assignable to type 'string'.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Type '() => number' is not assignable to type '(item: AudioTrack) => string'.\n Type 'number' is not assignable to type 'string'." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Type 'string' is not assignable to type 'boolean | undefined'.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Type 'string' is not assignable to type 'boolean | undefined'." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Argument of type 'null' is not assignable to parameter of type 'Option | undefined'.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Argument of type 'null' is not assignable to parameter of type 'Option'." + }, + { + "code": 2339, + "message": "Property 'unknownProperty' does not exist on type 'QualityLevel'." + } + ] + }, + { + "compiler": "5.9.3", + "mode": "nodenext-cjs", + "diagnostics": [], + "invalid": [ + { + "code": 2322, + "message": "Type 'void' is not assignable to type 'Promise'." + }, + { + "code": 2554, + "message": "Expected 0 arguments, but got 1." + }, + { + "code": 2322, + "message": "Type '\"dash\"' is not assignable to type '\"artplayerPluginDashControl\"'." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Type '(value: QualityLevel, index: number) => string' is not assignable to type '(item: QualityLevel) => string'.\n Target signature provides too few arguments. Expected 2 or more, but got 1.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Type '(value: QualityLevel, index: number) => string' is not assignable to type '(item: QualityLevel) => string'.\n Target signature provides too few arguments. Expected 2 or more, but got 1." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Type '() => number' is not assignable to type '(item: AudioTrack) => string'.\n Type 'number' is not assignable to type 'string'.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Type '() => number' is not assignable to type '(item: AudioTrack) => string'.\n Type 'number' is not assignable to type 'string'." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Type 'string' is not assignable to type 'boolean | undefined'.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Type 'string' is not assignable to type 'boolean | undefined'." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Argument of type 'null' is not assignable to parameter of type 'Option | undefined'.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Argument of type 'null' is not assignable to parameter of type 'Option'." + }, + { + "code": 2339, + "message": "Property 'unknownProperty' does not exist on type 'QualityLevel'." + } + ] + }, + { + "compiler": "5.9.3", + "mode": "nodenext-esm", + "diagnostics": [], + "invalid": [ + { + "code": 2322, + "message": "Type 'void' is not assignable to type 'Promise'." + }, + { + "code": 2554, + "message": "Expected 0 arguments, but got 1." + }, + { + "code": 2322, + "message": "Type '\"dash\"' is not assignable to type '\"artplayerPluginDashControl\"'." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Type '(value: QualityLevel, index: number) => string' is not assignable to type '(item: QualityLevel) => string'.\n Target signature provides too few arguments. Expected 2 or more, but got 1.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Type '(value: QualityLevel, index: number) => string' is not assignable to type '(item: QualityLevel) => string'.\n Target signature provides too few arguments. Expected 2 or more, but got 1." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Type '() => number' is not assignable to type '(item: AudioTrack) => string'.\n Type 'number' is not assignable to type 'string'.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Type '() => number' is not assignable to type '(item: AudioTrack) => string'.\n Type 'number' is not assignable to type 'string'." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Type 'string' is not assignable to type 'boolean | undefined'.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Type 'string' is not assignable to type 'boolean | undefined'." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Argument of type 'null' is not assignable to parameter of type 'Option | undefined'.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Argument of type 'null' is not assignable to parameter of type 'Option'." + }, + { + "code": 2339, + "message": "Property 'unknownProperty' does not exist on type 'QualityLevel'." + } + ] + }, + { + "compiler": "5.9.3", + "mode": "bundler-esm", + "diagnostics": [], + "invalid": [ + { + "code": 2322, + "message": "Type 'void' is not assignable to type 'Promise'." + }, + { + "code": 2554, + "message": "Expected 0 arguments, but got 1." + }, + { + "code": 2322, + "message": "Type '\"dash\"' is not assignable to type '\"artplayerPluginDashControl\"'." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Type '(value: QualityLevel, index: number) => string' is not assignable to type '(item: QualityLevel) => string'.\n Target signature provides too few arguments. Expected 2 or more, but got 1.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Type '(value: QualityLevel, index: number) => string' is not assignable to type '(item: QualityLevel) => string'.\n Target signature provides too few arguments. Expected 2 or more, but got 1." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Type '() => number' is not assignable to type '(item: AudioTrack) => string'.\n Type 'number' is not assignable to type 'string'.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Type '() => number' is not assignable to type '(item: AudioTrack) => string'.\n Type 'number' is not assignable to type 'string'." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Type 'string' is not assignable to type 'boolean | undefined'.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Type 'string' is not assignable to type 'boolean | undefined'." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Argument of type 'null' is not assignable to parameter of type 'Option | undefined'.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Argument of type 'null' is not assignable to parameter of type 'Option'." + }, + { + "code": 2339, + "message": "Property 'unknownProperty' does not exist on type 'QualityLevel'." + } + ] + }, + { + "compiler": "4.3.5", + "mode": "node10-commonjs", + "diagnostics": [], + "invalid": [ + { + "code": 2322, + "message": "Type 'void' is not assignable to type 'Promise'." + }, + { + "code": 2554, + "message": "Expected 0 arguments, but got 1." + }, + { + "code": 2322, + "message": "Type '\"dash\"' is not assignable to type '\"artplayerPluginDashControl\"'." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Type '(value: QualityLevel, index: number) => string' is not assignable to type '(item: QualityLevel) => string'.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Type '(value: QualityLevel, index: number) => string' is not assignable to type '(item: QualityLevel) => string'." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Type '() => number' is not assignable to type '(item: AudioTrack) => string'.\n Type 'number' is not assignable to type 'string'.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Type '() => number' is not assignable to type '(item: AudioTrack) => string'." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Type 'string' is not assignable to type 'boolean | undefined'.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Type 'string' is not assignable to type 'boolean | undefined'." + }, + { + "code": 2769, + "message": "No overload matches this call.\n Overload 1 of 2, '(option?: Option | undefined): (art: Artplayer) => Result', gave the following error.\n Argument of type 'null' is not assignable to parameter of type 'Option | undefined'.\n Overload 2 of 2, '(option: Option): (art: Artplayer) => Result', gave the following error.\n Argument of type 'null' is not assignable to parameter of type 'Option'." + }, + { + "code": 2339, + "message": "Property 'unknownProperty' does not exist on type 'QualityLevel'." + } + ] + } + ] + }, + "files": [ + { + "file": "D:/github/ArtPlayer/refactor/.cache/dash-package-types-3hk1W5/artplayer-pack.log", + "sha256": "a3d19be241339c242540b0a1571d87c99aa14aba1c06da9aa703603a130d5595", + "bytes": 110 + }, + { + "file": "D:/github/ArtPlayer/refactor/.cache/dash-package-types-3hk1W5/artplayer-plugin-dash-control-pack.log", + "sha256": "5f9a97a1b4963467d7836fdc1b8dab8069bd485ac59f6faef0be26e63de98e82", + "bytes": 130 + }, + { + "file": "D:/github/ArtPlayer/refactor/.cache/dash-package-types-3hk1W5/artplayer-plugin-dash-control.tgz", + "sha256": "3d2cb1162ca1d2a74b6bb1ec2d134d8955921896b28a311b289d6601901374cd", + "bytes": 11253 + }, + { + "file": "D:/github/ArtPlayer/refactor/.cache/dash-package-types-3hk1W5/artplayer.tgz", + "sha256": "2139af017670a4f30f667bf5fdc1aa680f3e03b9c8d3cb767fc92d6345aedff5", + "bytes": 280395 + }, + { + "file": "D:/github/ArtPlayer/refactor/.cache/dash-package-types-3hk1W5/frozen-install.log", + "sha256": "6d8a95fad69ac94a55d176b472fc3a0f72783092e49b7e683156b6717510f4a8", + "bytes": 56 + }, + { + "file": "D:/github/ArtPlayer/refactor/.cache/dash-package-types-3hk1W5/install.log", + "sha256": "c3b09f4c65bfb4a1bf31ddd2e3328c22988cf52a31e36c31ea2de4d3132a89c6", + "bytes": 142 + }, + { + "file": "D:/github/ArtPlayer/refactor/.cache/dash-package-types-3hk1W5/report.json", + "sha256": "d7bd0c11d2386af0fee27adb7c53e8cfef0becc59f206e9ba7bcc72944d544f2", + "bytes": 28247 + }, + { + "file": "D:/github/ArtPlayer/refactor/.cache/dash-package-types-3hk1W5/yarn.lock", + "sha256": "ca33f5f31183de5ca77ed3b78199b1a423f6a10d6aba56882301ae6dda1f9b69", + "bytes": 1173 + } + ] + }, + "ci": { + "command": "yarn ci:check", + "exitCode": 0, + "tests": 720, + "unit": 663, + "engineering": 14, + "baseline": 43, + "strictProductionTS": 261, + "evidence": { + "file": "refactor/.cache/dash05-nullable-ci.log", + "sha256": "e0ba98c0d7813b05ed84962826f958dc13bc7ffca41626a048c54213f97d7fca", + "bytes": 75456 + }, + "scope": "Node/engineering/type gates, not the open real-media browser matrix", + "followUp": "Only fixture import order and SDK-only projection/identity guard changed after the full CI; scoped lint and all ten SDK type combinations passed again in dash05-sdk-types-test-final.log." + } +} diff --git a/refactor/baselines/dash-type-dependencies.json b/refactor/baselines/dash-type-dependencies.json new file mode 100644 index 000000000..c0e7d8643 --- /dev/null +++ b/refactor/baselines/dash-type-dependencies.json @@ -0,0 +1,93 @@ +{ + "schemaVersion": 1, + "task": "PKG-DASH-05", + "sdk": "dashjs@5.2.1", + "source": "package/index.d.ts import and package/package.json exact dependency", + "releases": [ + { + "name": "@svta/cml-request", + "version": "1.0.12", + "tarball": "https://registry.npmjs.org/@svta/cml-request/-/cml-request-1.0.12.tgz", + "integrity": "sha512-4sJvnnoNpq58j2mCGP8k+MF6wVy/qa4gbt6kfT1dPIKmn3mPxw+JVfilhcWsUi+peK2yCZxOJJYyHj1cAcQE1w==", + "sha256": "43fa74a88a2b9e63cbf21b1e2474d2f31daa915b50939000df0526c98e09585e", + "files": { + "package/LICENSE": "95cdf13a152329c8a60cf739d442f578a172727f0584bff42406126719312f62", + "package/README.md": "a637c158ad890ecc643e13e93f29c1de7d582d2ae15e6b220f51f1642a0843c7", + "package/dist/index.d.ts": "982f2bbcb90aaa26bb6f8a58eb51868044444b22621204029aa7966871a67676", + "package/dist/index.d.ts.map": "a91339ae00c3d43ecb8d4d23670c1f7be759c6b658a56fd805309417b1a36f63", + "package/dist/index.js": "b9d39ada6e7a52b7c924306461f36a7e18e04f6345aa62d9d93298890dd2c259", + "package/dist/tsdoc-metadata.json": "12c1f31364a22600ae0cb9acb5e3a91ca3e3959e8f1d572dc772764f0b10e53d", + "package/package.json": "0d0859ef653c52a0992e205cfb1b8c2ef8996dfaa6bb37c63b0a195c3b6dd2fc" + } + }, + { + "name": "@svta/cml-utils", + "version": "1.5.0", + "tarball": "https://registry.npmjs.org/@svta/cml-utils/-/cml-utils-1.5.0.tgz", + "integrity": "sha512-JMqclD7Akd+GSJiuaYNUHOP2wNtf/nauKeszlYeivSHfi0Lp3pmSW5PXDvJ2dO4aPmmSOQbF0ztTsW9Vcs2Whw==", + "sha256": "a18a61b0136b57ffe695b0ed7421056e86730be3a6073c914f785fed11e89ce0", + "files": { + "package/LICENSE": "95cdf13a152329c8a60cf739d442f578a172727f0584bff42406126719312f62", + "package/README.md": "15cd397de0b8a04b2cd377da9e6e7bf2a32004acb7a564481eaa20c868f0cc4b", + "package/dist/index.d.ts": "bfb26c90339ebfb233f49c054e9996bdc380bb99967a73b97e56d431db59351d", + "package/dist/index.d.ts.map": "1b2e804c7538ed47a6ce649632f786f10ea6194506416990e73db6f4b6930e59", + "package/dist/index.js": "9a3478ae9426f3f61bcd44c07b9bd014134cdb812c5ebe753b9d3b48c232d3e5", + "package/dist/index.js.map": "f8b3dcaa69e91fef72dc8ee497b3914586bb05c3eb2b1111e9e2c160e829aa95", + "package/dist/tsdoc-metadata.json": "12c1f31364a22600ae0cb9acb5e3a91ca3e3959e8f1d572dc772764f0b10e53d", + "package/package.json": "3a8735b7354a1af65fe7fc4bfdc01980d088aba8f42b11e0a9b58f57907237f9" + } + }, + { + "name": "@svta/cml-cmcd", + "version": "2.3.2", + "tarball": "https://registry.npmjs.org/@svta/cml-cmcd/-/cml-cmcd-2.3.2.tgz", + "integrity": "sha512-SKBBjLmci0WK8HMjuv+36tVIMktonoOoxsXblOFZmB+ePPV2zjRMTD+2ZmE/1VEPJkKHENyhSjSHgJyeOlvZ1A==", + "sha256": "cff935fc624e365458f1e979d11ac707e45705eea47115ba6f5cac40ac18c0c5", + "files": { + "package/LICENSE": "5994a6fd6ce598174918ed40464bda1cf7f9a43248912bc62134b6020c6641c8", + "package/README.md": "3f28f6cb1244ea05dbf1a51b3322139a8a14e0a7213ce4c0346169630c58c4db", + "package/dist/index.d.ts": "d65aeda281887f5a1f68f0b009373d9a72ec020e7daf15c8400f14daa93f96f8", + "package/dist/index.d.ts.map": "2b9876b41f609dee7b2b3b46f29bd9a7ce55fb07964747c64966478027e33e28", + "package/dist/index.js": "69fbeffaaa20221ddc8d417e93bad1ad7b52c31f2dbebf75a6bb0378bc2ef6fc", + "package/dist/index.js.map": "4f0276e5c2381f028a12d31179e1a7ace15d121bc233bad2bc8541dca924b330", + "package/dist/tsdoc-metadata.json": "12c1f31364a22600ae0cb9acb5e3a91ca3e3959e8f1d572dc772764f0b10e53d", + "package/package.json": "955b1bc107d3c546ec64c69415fdfe0d84fc702e06f286789c72fb62109e3415" + } + }, + { + "name": "@svta/cml-xml", + "version": "1.1.4", + "tarball": "https://registry.npmjs.org/@svta/cml-xml/-/cml-xml-1.1.4.tgz", + "integrity": "sha512-jbixqjiJIc16SGxylHwiOzO+DuhkGfuP+fJ9AHeVJKdFDKnabgfCDpnp6dvZpZnjMj4nHvzVtuUV7RISPIwYXw==", + "sha256": "4978a82e0808a08d7ae7e022e00d21cc0c89429315cdea05a3883e0451c217cb", + "files": { + "package/LICENSE": "95cdf13a152329c8a60cf739d442f578a172727f0584bff42406126719312f62", + "package/README.md": "60642dc6e6bdf70028142071388f8f38ebc51ef10bb2360c0c6ad7e9774eeb20", + "package/dist/index.d.ts": "abff2449b6a062f6adba6998e62f4de0ed4ca562c6d151aa85e9e4d71a55da14", + "package/dist/index.d.ts.map": "fd3dd2d889693c611e11bc3a647bee0df2b6703dd7f025f3702952f2f7a314b2", + "package/dist/index.js": "e81ecb78b99526748defd4e2287959e1b4258c03168ac20bde45e4bcb16c5c3b", + "package/dist/index.js.map": "5b99885f2b56d0da7ff07731531b7c80ee128182fb270ea3211fa1692af52191", + "package/dist/tsdoc-metadata.json": "12c1f31364a22600ae0cb9acb5e3a91ca3e3959e8f1d572dc772764f0b10e53d", + "package/package.json": "cf832fa49cd767dd063e427b10dbdccb82ee2f04a747e4eec11803e773adbef5" + } + }, + { + "name": "@svta/cml-structured-field-values", + "version": "1.1.3", + "tarball": "https://registry.npmjs.org/@svta/cml-structured-field-values/-/cml-structured-field-values-1.1.3.tgz", + "integrity": "sha512-XqLzQOTznz6kh/nsSh8dy1kV7GQjL4csG+2U5EvLGhAqNuNUczbVg5EAsDobKDVg8xhdthdXx2UuwM+ZHQCxSg==", + "sha256": "0a8c33b8e1858376fa640eea5ea4fd78c1ea642cbbed6bb60319ae6594fce4fa", + "files": { + "package/LICENSE": "95cdf13a152329c8a60cf739d442f578a172727f0584bff42406126719312f62", + "package/README.md": "a42aa5169cb75f1b2c263a633874414f4beeda4741ceb25e3a41756ad7e12ae3", + "package/dist/index.d.ts": "b1aa7705715d801d381fce0b9f151b85f236f16a6eaf711ba46ee94f6b4dcaff", + "package/dist/index.d.ts.map": "f40757a3886a90a24d69c761d2b061dda8990598be8c752377be5006ddab4d6a", + "package/dist/index.js": "fe057a1c6bc86786c3eacf39a797d850f74327214771a99cd77d7b07b1570955", + "package/dist/index.js.map": "d362481ef0cd65f8f8baaea1f1fe4f035475daf62b4d305aced026f44126c34d", + "package/dist/tsdoc-metadata.json": "12c1f31364a22600ae0cb9acb5e3a91ca3e3959e8f1d572dc772764f0b10e53d", + "package/package.json": "cf83f2aedb4e7a3cef6e8eeb31974cd6dc96197f964b39f8ff1e3716f3a8d367" + } + } + ], + "note": "Test-only actual SDK declaration dependency. Preserve the actual package manifest and exports when resolving; no production dependency or declaration shim." +} diff --git a/refactor/changes/2026-09-12-PKG-DASH-05-sdk-types.md b/refactor/changes/2026-09-12-PKG-DASH-05-sdk-types.md new file mode 100644 index 000000000..7143bfce1 --- /dev/null +++ b/refactor/changes/2026-09-12-PKG-DASH-05-sdk-types.md @@ -0,0 +1,65 @@ +# PKG-DASH-05:真实 SDK 声明与 nullable 音轨修正 + +起点 `c4b5f5f4`。本步推进实际 dash.js 类型消费者;媒体 seek 风险、SDK 自动刷新与设备 +验收保持独立,DASH-05 仍 doing。没有修改运行行为、增加生产依赖或改变版本。 + +## 发现与修正 + +真实 npm dash.js 4.5.2/5.2.1 的 MediaInfo 均声明 id、index、lang 可为 null。04 新增的 +AudioTrack 只表达 undefined,实际 SDK 的轨道无法赋给该类型。已先保存十组消费者的 +TS2322 失败,再补齐公开字段的 null。内部 AudioFields 直接复用 AudioTrack,Label +表达现有默认格式化器可能返回 null 的行为,避免公开与内部类型再次漂移。 + +新增 nullable 轨道运行回归:保留 null label、原轨道对象身份与同步选择,不把缺失标签 +改成新显示策略。既有 npm 发布类型使用 object 回调,没有这些新字段;旧 object 用法、 +Parameters 配置提取、同步 update、模块入口仍通过原有兼容测试。新自定义 formatter +依然必须返回 string,实际 SDK 的 nullable lang 应通过 fallback 转为字符串。 + +首次集成夹具直接返回 track.lang,正确触发了 string|null 到 string 的错误;先修正这条 +消费者写法,再单独加入 MediaInfo 到默认 AudioTrack 的赋值复现真正类型缺陷。 +两批失败诊断分别保留,未把消费者错误当成生产缺陷或放宽 formatter 返回类型。 + +## 实际类型依赖与解析 + +dash.js 5.2.1 声明引用 @svta/cml-request 1.0.12。按实际 manifest 中固定的 peer 版本, +补齐 cml-utils 1.5.0、cml-cmcd 2.3.2、cml-xml 1.1.4、cml-structured-field-values 1.1.3。 +五个归档全部校验 npm SHA512 integrity/SHA256、完整文件成员与许可证来源;保留原始 +package.json/exports,没有添加类型 shim、paths 映射、环境类型或 skipLibCheck。 + +归档工具现在支持合法 scoped npm 包,缓存文件名将 scope 分隔符转换为加号,仍限制 +名称/版本,保持原无 scope 缓存路径。补充路径穿越、反斜杠、伪 scope 与缓存别名负例。 + +`dash-sdk-types.mjs` 将实际 SDK 声明与 manifest、上述完整小型依赖包放进临时 node_modules, +用工作区候选公开声明编译 SDK-only、正例、非法用法三种消费者。它是声明投影测试, +不是完整安装 SDK 的运行时验收;独立 Yarn tarball 类型测试仍负责插件的隔离分发。 + +| SDK / 编译器与模式 | SDK-only | 加入候选插件 | +| --- | --- | --- | +| 4.5.2 / TS 5.9.3 四种模式、TS 4.3.5 Node10 | 0 诊断 | 0 诊断 | +| 5.2.1 / TS 5.9.3 NodeNext CJS、NodeNext ESM、Bundler | 0 诊断 | 0 诊断 | +| 5.2.1 / TS 5.9.3 Node10 | 1:无法解析仅通过 exports 暴露的 cml-request 类型 | 完全相同 | +| 5.2.1 / TS 4.3.5 Node10 | 2:上述模块解析问题、旧 DOM 库无 FontFace | 完全相同 | + +每组移除 expect-error 后恰好新增错误返回类型和不存在的 SDK 属性两个诊断。预期值 +冻结的是经审查的 SDK-only 诊断和实际加载文件;插件必须增加零诊断。不能把两组上游 +不兼容配置表述为零错误编译,也不以冻结上游诊断免除后续 SDK 升级复核。 + +## 验证和后续 + +来源见 [类型依赖](../baselines/dash-type-dependencies.json),上游边界见 +[诊断矩阵](../baselines/dash-sdk-type-diagnostics.json),执行与产物证据见 +[本步记录](../baselines/dash-sdk-types-validation.json)。 + +标准 build:ts 生成编辑器声明,标准 package build 运行后 JS 三格式字节保持原样。 +源码 Node 118 项、三格式 Node 274 项通过;真实 Monaco 三引擎 3 项通过,无重试/跳过。 +工作区外 Yarn tarball 安装/冻结重装后的五种类型模式通过,每种八条非法用法仍拒绝。 +隔离类型脚本的报告改为标识可复用 suite 和 introducedBy,避免后续执行被误读成 04 当时的 +结果。初次证据整理误把 docs/compiled 的平铺结构写成子目录,导致证据未生成并触发计划 +链接检查失败;已按实际构建器 cpy(flat:true) 修正记录脚本,保留失败日志。 +完整工程检查 720 项通过(663 单元、14 工程、43 基线),261 个生产 TS 文件严格检查通过。 +随后仅整理夹具 import 顺序、SDK-only 抽取与身份校验,局部 lint 和全部十组类型矩阵再次 +通过;详见机器证据。不将类型测试替代仍有开放失败的真实 DASH 播放验收。 + +当前仍为 217 项:74 done、4 doing、139 todo。接续 DASH-SEEK-01、SDK 驱动刷新/错误、 +legacy 实际 SDK 媒体、有效设备和 06 的示例/完整分发。此次为独立本地检查点,不推送发布。 +回退本步应一起恢复公开/内部/生成声明及消费者测试,但保留前一检查点媒体失败证据。 diff --git a/refactor/dash-validation.md b/refactor/dash-validation.md index d47c9af39..7b267d5a6 100644 --- a/refactor/dash-validation.md +++ b/refactor/dash-validation.md @@ -7,7 +7,7 @@ ## 可重跑的测试 -- `yarn test:dash-control`:原有 5 项过滤/稳定 ID 回归、80 项行为/历史观察、31 项候选生命周期,共 116 项。 +- `yarn test:dash-control`:原有 5 项过滤/稳定 ID 回归、80 项行为/历史观察、33 项候选生命周期,共 118 项。 该脚本和 `test:unit` 都保留旧测试,完整 CI 自动执行。 - `yarn test:browser test/browser/dash-control.spec.js --trace on`:84 项,两个核心、发布插件 SDK 4/ 候选插件 SDK 4/5、两类菜单、两种选择及候选清理、Chromium/Firefox/WebKit。 @@ -26,10 +26,14 @@ - `node --test refactor/scripts/dash-sdk.test.mjs`:SDK 归档/成员/许可证来源、媒体指纹与拓扑。 如需重新合成诊断媒体,用 `node scripts/generate-dash-fixture.mjs refactor/.cache/new-dash-media`, 输出目录必须不存在;可通过 `ARTPLAYER_FFMPEG` 指定 FFmpeg,不覆盖已冻结输入。 +- `node --test refactor/scripts/dash-sdk-types.test.mjs`:实际 SDK 和固定类型依赖,十组编译器/ + 模块配置;插件正例不得增加 SDK-only 诊断,两条非法用法均拒绝。旧解析/DOM 库的上游 + 边界详见 [类型矩阵](changes/2026-09-12-PKG-DASH-05-sdk-types.md)。CLI + `node refactor/scripts/dash-sdk-types.mjs` 只生成诊断报告,验收应运行上述 test 命令。 Node helper 分别加载当前源码、固定 Git 提交的旧工作区 UMD、实际 npm main/legacy/module。 Git 内容以 LF 指纹核对,发布归档与成员以原始字节指纹核对。`ARTPLAYER_TEST_DASH` 可指定 -待测产物,以系统路径分隔符连接;同时指定 main/legacy/module 时共 266 项,包含两代 SDK 的 +待测产物,以系统路径分隔符连接;同时指定 main/legacy/module 时共 274 项,包含两代 SDK 的 行为与生命周期。未设置时不会把源码测试冒充三种候选产物验证。 `test/helpers/dash-control.js` 只提供可控 SDK 方法和组件注册表,检查 this、类型参数、 diff --git a/refactor/fixtures/consumers/dash-sdk-v4.ts b/refactor/fixtures/consumers/dash-sdk-v4.ts new file mode 100644 index 000000000..d0fd36150 --- /dev/null +++ b/refactor/fixtures/consumers/dash-sdk-v4.ts @@ -0,0 +1,27 @@ +import type Artplayer from 'artplayer' +import type { AudioTrack, Option, QualityLevel, Result } from 'artplayer-plugin-dash-control' +import type { BitrateInfo, MediaInfo, MediaPlayerClass } from 'dashjs' +import dash from 'artplayer-plugin-dash-control' + +export type SDKInputs = [BitrateInfo, MediaInfo, MediaPlayerClass] +declare const sdk: MediaPlayerClass +export const levels = sdk.getBitrateInfoListFor('video') +export const tracks = sdk.getTracksFor('audio') + +// Candidate plugin consumer. +declare const art: Artplayer +const option: Option = { + quality: { getName: level => `${level.qualityIndex}:${level.height}` }, + audio: { getName: track => `${track.lang}:${track.index}` }, +} +const result: Result = dash(option)(art) +const synchronous: void = result.update() +dash({ quality: { getName: (level: BitrateInfo) => String(level.bitrate) }, audio: { getName: (track: MediaInfo) => track.lang || String(track.id) } }) +const defaultTrack: AudioTrack = tracks[0]! +const defaultLevel: QualityLevel = levels[0]! +const legacy: Parameters[0]['quality'] = { getName: (level: object) => String(level) } +// @ts-expect-error SDK quality formatters must return strings. +dash({ quality: { getName: level => level.height } }) +// @ts-expect-error Actual SDK fields must not become any. +dash({ audio: { getName: track => track.nonexistentArtplayerField } }) +void [synchronous, legacy, defaultTrack, defaultLevel] diff --git a/refactor/fixtures/consumers/dash-sdk-v5.ts b/refactor/fixtures/consumers/dash-sdk-v5.ts new file mode 100644 index 000000000..357898a97 --- /dev/null +++ b/refactor/fixtures/consumers/dash-sdk-v5.ts @@ -0,0 +1,27 @@ +import type Artplayer from 'artplayer' +import type { AudioTrack, Option, QualityLevel, Result } from 'artplayer-plugin-dash-control' +import type { MediaInfo, MediaPlayerClass, Representation } from 'dashjs' +import dash from 'artplayer-plugin-dash-control' + +export type SDKInputs = [Representation, MediaInfo, MediaPlayerClass] +declare const sdk: MediaPlayerClass +export const levels = sdk.getRepresentationsByType('video') +export const tracks = sdk.getTracksFor('audio') + +// Candidate plugin consumer. +declare const art: Artplayer +const option: Option = { + quality: { getName: level => `${level.id}:${level.height}` }, + audio: { getName: track => `${track.lang}:${track.index}` }, +} +const result: Result = dash(option)(art) +const synchronous: void = result.update() +dash({ quality: { getName: (level: Representation) => String(level.bandwidth) }, audio: { getName: (track: MediaInfo) => track.lang || String(track.id) } }) +const defaultTrack: AudioTrack = tracks[0]! +const defaultLevel: QualityLevel = levels[0]! +const legacy: Parameters[0]['quality'] = { getName: (level: object) => String(level) } +// @ts-expect-error SDK quality formatters must return strings. +dash({ quality: { getName: level => level.height } }) +// @ts-expect-error Actual SDK fields must not become any. +dash({ audio: { getName: track => track.nonexistentArtplayerField } }) +void [synchronous, legacy, defaultTrack, defaultLevel] diff --git a/refactor/plan.md b/refactor/plan.md index 9d9592e08..ad97accb9 100644 --- a/refactor/plan.md +++ b/refactor/plan.md @@ -483,4 +483,4 @@ - PKG-DASH-02: [记录](changes/2026-09-12-PKG-DASH-02-tests.md) [记录](dash-validation.md) [记录](baselines/dash-validation.json) - PKG-DASH-03: [记录](changes/2026-09-12-PKG-DASH-03-runtime.md) [记录](baselines/dash-runtime.json) [记录](dash-validation.md) - PKG-DASH-04: [记录](changes/2026-09-12-PKG-DASH-04-types.md) [记录](baselines/dash-types-validation.json) [记录](dash-validation.md) -- PKG-DASH-05: [记录](changes/2026-09-12-PKG-DASH-05-sdk-checkpoint.md) [记录](baselines/dash-sdk.json) [记录](baselines/dash-sdk-checkpoint.json) [记录](dash-validation.md) +- PKG-DASH-05: [记录](changes/2026-09-12-PKG-DASH-05-sdk-checkpoint.md) [记录](baselines/dash-sdk.json) [记录](baselines/dash-sdk-checkpoint.json) [记录](dash-validation.md) [记录](changes/2026-09-12-PKG-DASH-05-sdk-types.md) [记录](baselines/dash-sdk-types-validation.json) diff --git a/refactor/progress.md b/refactor/progress.md index 73445b85a..69e66faaf 100644 --- a/refactor/progress.md +++ b/refactor/progress.md @@ -1,5 +1,20 @@ # 进度与证据 +## 当前实施:DASH-05 实际 SDK 类型与 nullable 元数据 + +实际 dash.js 4.5.2/5.2.1 类型消费者已接入,固定五个 @svta 类型依赖及原始 exports。 +发现并修正两代 SDK 的 nullable id/index/lang 无法赋给新 AudioTrack 的问题;内部类型 +直接复用公开形状,运行逻辑不变,重新构建的三份 JS 与 04 指纹逐字节一致。 + +十组 SDK/编译器/模块配置中八组零诊断,两组 SDK 5/旧解析方式保留 SDK 自身诊断; +候选插件均增加零诊断,两条非法用法均拒绝。源码 Node 118、三格式 274、Monaco 三引擎 +3 项通过;隔离 Yarn tarball 的五种类型模式和每组八条非法用法通过。 +完整工程 CI 720 项通过、261 个生产 TS 文件严格检查通过;最后的夹具整理已单独重跑十组类型矩阵。 + +任务仍为 74 done、4 doing、139 todo。DASH-SEEK-01、SDK 自动状态刷新、legacy 真实媒体、 +有效设备和完整分发仍未完成。详见 [本步说明](changes/2026-09-12-PKG-DASH-05-sdk-types.md) +与 [执行记录](baselines/dash-sdk-types-validation.json)。以下为各检查点当时的状态。 + ## 当前实施:DASH-05 真实 SDK 与 MPD 检查点 已固定 npm dash.js 4.5.2/5.2.1 归档/成员/许可证指纹,新增本地双画质双音轨 DASH、 diff --git a/refactor/risks.json b/refactor/risks.json index 72c39d78d..5ae785051 100644 --- a/refactor/risks.json +++ b/refactor/risks.json @@ -2931,7 +2931,9 @@ "refactor/baselines/dash-types-validation.json", "refactor/changes/2026-09-12-PKG-DASH-04-types.md", "test/types/dash-control.ts", - "refactor/scripts/dash-package-types.mjs" + "refactor/scripts/dash-package-types.mjs", + "refactor/changes/2026-09-12-PKG-DASH-05-sdk-types.md", + "refactor/baselines/dash-sdk-types-validation.json" ], "resolutionRationale": "五个自有 TS 模块严格检查通过,真实旧 npm 声明/候选消费者在 TS 4.3/5.9 兼容,五种模块模式及非法用法验证、真实 Monaco、工作区外 Yarn tarball 安装与类型检查通过。只关闭插件自身声明和格式解析问题,实际 SDK 类型/媒体矩阵仍由 05 接续。" }, diff --git a/refactor/scripts/dash-package-types.mjs b/refactor/scripts/dash-package-types.mjs index 61a5dd5c1..0517c246b 100644 --- a/refactor/scripts/dash-package-types.mjs +++ b/refactor/scripts/dash-package-types.mjs @@ -70,7 +70,7 @@ const option: dash.Option = { quality: { getName: level => String(level.height) assert.equal(invalid.length, 8, 'Installed package must reject all invalid uses') matrix.push({ compiler: compiler.version, mode, diagnostics, invalid }) } - const report = { task: 'PKG-DASH-04', scope: 'Packed current core and DASH, offline Yarn install and frozen reinstall outside workspace; isolated public type acceptance only, not complete package runtime/SDK/media release validation.', packages, matrix } + const report = { suite: 'dash-isolated-package-types', introducedBy: 'PKG-DASH-04', scope: 'Packed current core and DASH, offline Yarn install and frozen reinstall outside workspace; isolated public type acceptance only, not complete package runtime/SDK/media release validation.', packages, matrix } writeJson(path.join(output, 'report.json'), report) console.log(`DASH installed type matrix passed: ${matrix.length} modes, eight invalid uses rejected in each; ${output}`) } diff --git a/refactor/scripts/dash-sdk-types.mjs b/refactor/scripts/dash-sdk-types.mjs new file mode 100644 index 000000000..097346bae --- /dev/null +++ b/refactor/scripts/dash-sdk-types.mjs @@ -0,0 +1,93 @@ +import assert from 'node:assert/strict' +import fs from 'node:fs' +import path from 'node:path' +import process from 'node:process' +import { fileURLToPath } from 'node:url' +import ts from 'typescript' +import compat from 'typescript-compat' +import { archiveFiles, ensureArchive, hash, readMember, refactorDir } from './releases.mjs' + +const root = path.resolve(refactorDir, '..') +const modes = [[ts, 'node10-commonjs'], [ts, 'nodenext-cjs'], [ts, 'nodenext-esm'], [ts, 'bundler-esm'], [compat, 'node10-commonjs']] + +async function copyRelease(release, directory, members) { + const archive = await ensureArchive(release) + if (!members) + assert.deepEqual(archiveFiles(archive), Object.keys(release.files).sort()) + for (const member of members || Object.keys(release.files)) { + const bytes = readMember(archive, member) + assert.equal(hash(bytes), release.files[member], member) + const destination = path.resolve(directory, 'node_modules', release.name, member.slice('package/'.length)) + assert(destination.startsWith(path.resolve(directory, 'node_modules') + path.sep)) + fs.mkdirSync(path.dirname(destination), { recursive: true }) + fs.writeFileSync(destination, bytes) + } +} + +export async function checkDashSDKTypes() { + const sdkInputs = JSON.parse(fs.readFileSync(path.join(refactorDir, 'baselines/dash-sdk.json'))) + const dependencies = JSON.parse(fs.readFileSync(path.join(refactorDir, 'baselines/dash-type-dependencies.json'))) + const directory = fs.mkdtempSync(path.join(refactorDir, '.cache/dash-sdk-types-')) + const results = [] + try { + for (const { release } of sdkInputs.sdks) { + const workspace = path.join(directory, release.version) + await copyRelease(release, workspace, ['package/package.json', 'package/index.d.ts']) + if (release.version === '5.2.1') { + for (const dependency of dependencies.releases) + await copyRelease(dependency, workspace) + const manifest = JSON.parse(fs.readFileSync(path.join(workspace, 'node_modules/dashjs/package.json'))) + assert.equal(manifest.dependencies['@svta/cml-request'], '1.0.12') + for (const dependency of dependencies.releases) { + const metadata = JSON.parse(fs.readFileSync(path.join(workspace, 'node_modules', dependency.name, 'package.json'))) + for (const [name, version] of Object.entries(metadata.peerDependencies || {})) + assert(dependencies.releases.some(peer => peer.name === name && peer.version === version), `Missing exact peer ${name}@${version}`) + } + } + const fixture = path.join(refactorDir, `fixtures/consumers/dash-sdk-v${release.version[0]}.ts`) + const source = fs.readFileSync(fixture, 'utf8') + assert(source.includes('// Candidate plugin consumer.')) + for (const [compiler, mode] of modes) { + const next = mode.startsWith('nodenext') + const filename = path.join(workspace, `consumer.${next ? mode.endsWith('-cjs') ? 'cts' : 'mts' : 'ts'}`) + const options = { strict: true, noEmit: true, skipLibCheck: false, types: [], esModuleInterop: true, target: compiler.ScriptTarget.ES2020, lib: ['lib.es2020.d.ts', 'lib.dom.d.ts'], module: next ? compiler.ModuleKind.NodeNext : mode === 'bundler-esm' ? compiler.ModuleKind.ESNext : compiler.ModuleKind.CommonJS, moduleResolution: next ? compiler.ModuleResolutionKind.NodeNext : mode === 'bundler-esm' ? compiler.ModuleResolutionKind.Bundler : compiler.ModuleResolutionKind.NodeJs } + function compile(code) { + fs.writeFileSync(filename, code) + const program = compiler.createProgram([filename], options) + const files = program.getSourceFiles().map(file => path.resolve(file.fileName)) + assert(files.includes(path.join(workspace, 'node_modules/dashjs/index.d.ts')), 'Actual SDK declaration was not loaded') + const hasPlugin = files.some(file => fs.realpathSync(file) === fs.realpathSync(path.join(root, 'packages/artplayer-plugin-dash-control/types/artplayer-plugin-dash-control.d.ts'))) + assert.equal(hasPlugin, code.includes('// Candidate plugin consumer.'), 'Only plugin consumers must load the candidate declaration') + const diagnostics = compiler.getPreEmitDiagnostics(program).map(item => ({ + file: item.file ? path.relative(workspace, item.file.fileName).replaceAll('\\', '/').replace(/^consumer\.[cm]?ts$/, 'consumer.ts') : null, + code: item.code, + line: item.file && item.start !== undefined ? item.file.getLineAndCharacterOfPosition(item.start).line + 1 : null, + message: compiler.flattenDiagnosticMessageText(item.messageText, '\n').replaceAll(workspace.replaceAll('\\', '/'), '').replaceAll(root.replaceAll('\\', '/'), ''), + })) + return { diagnostics, files: files.filter(file => file.startsWith(path.join(workspace, 'node_modules'))).map(file => path.relative(workspace, file).replaceAll('\\', '/')) } + } + const sdkSource = source.split('// Candidate plugin consumer.')[0] + .replace(/^import .+ from '(?:artplayer|artplayer-plugin-dash-control)'\r?\n/gm, '') + const sdkOnly = compile(sdkSource) + const candidate = compile(source) + const invalid = compile(source.replaceAll(/\/\/ @ts-expect-error[^\n]*\n/g, '')) + results.push({ sdk: release.version, compiler: compiler.version, mode, sdkOnly, candidate, invalid }) + } + } + return results + } + finally { + const resolved = fs.realpathSync(directory) + assert.equal(path.dirname(resolved), fs.realpathSync(path.join(refactorDir, '.cache'))) + assert(path.basename(resolved).startsWith('dash-sdk-types-')) + fs.rmSync(resolved, { recursive: true, force: true }) + } +} + +if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) { + const results = await checkDashSDKTypes() + const report = path.join(refactorDir, '.cache/dash-sdk-type-diagnostics.json') + fs.writeFileSync(report, `${JSON.stringify(results, null, 2)}\n`) + console.log(results.map(row => ({ sdk: row.sdk, compiler: row.compiler, mode: row.mode, sdkOnly: row.sdkOnly.diagnostics.length, candidate: row.candidate.diagnostics.length, invalid: row.invalid.diagnostics.length }))) + console.log(report) +} diff --git a/refactor/scripts/dash-sdk-types.test.mjs b/refactor/scripts/dash-sdk-types.test.mjs new file mode 100644 index 000000000..d23ff12ea --- /dev/null +++ b/refactor/scripts/dash-sdk-types.test.mjs @@ -0,0 +1,23 @@ +import assert from 'node:assert/strict' +import fs from 'node:fs' +import path from 'node:path' +// eslint-disable-next-line test/no-import-node-test -- Compare exact actual SDK compiler diagnostics. +import test from 'node:test' +import { checkDashSDKTypes } from './dash-sdk-types.mjs' +import { refactorDir } from './releases.mjs' + +test('actual DASH SDK types retain upstream diagnostics while candidate options add none', async () => { + const baseline = JSON.parse(fs.readFileSync(path.join(refactorDir, 'baselines/dash-sdk-type-diagnostics.json'))) + const results = await checkDashSDKTypes() + assert.equal(results.length, 10) + assert.equal(baseline.matrix.length, results.length) + for (const row of results) { + const expected = baseline.matrix.find(item => item.sdk === row.sdk && item.compiler === row.compiler && item.mode === row.mode) + assert(expected, `Missing frozen SDK row ${row.sdk}/${row.compiler}/${row.mode}`) + assert.deepEqual(row.sdkOnly, expected.sdkOnly, 'Upstream SDK declaration diagnostics or resolved files changed') + assert.deepEqual(row.candidate, row.sdkOnly, 'Candidate plugin added errors to an actual SDK consumer') + const errors = row.invalid.diagnostics.filter(item => item.file === 'consumer.ts') + assert.deepEqual(errors.map(item => item.code), [2769, 2339], 'Invalid formatter return and missing SDK field must both be rejected') + assert.deepEqual(row.invalid.diagnostics.filter(item => item.file !== 'consumer.ts'), row.sdkOnly.diagnostics) + } +}) diff --git a/refactor/scripts/releases.mjs b/refactor/scripts/releases.mjs index 5cf8409ec..02d93285d 100644 --- a/refactor/scripts/releases.mjs +++ b/refactor/scripts/releases.mjs @@ -30,8 +30,8 @@ export function readMember(archive, member) { } export async function ensureArchive(release) { - assert(/^[a-z0-9]+(?:[.-][a-z0-9]+)*$/.test(release.name) && /^\d+\.\d+\.\d+$/.test(release.version), 'Invalid release identifier') - const archive = path.join(cacheDir, `${release.name}-${release.version}.tgz`) + assert(/^(?:@[a-z0-9]+(?:[.-][a-z0-9]+)*\/)?[a-z0-9]+(?:[.-][a-z0-9]+)*$/.test(release.name) && /^\d+\.\d+\.\d+$/.test(release.version), 'Invalid release identifier') + const archive = path.join(cacheDir, `${release.name.replace('/', '+')}-${release.version}.tgz`) if (!fs.existsSync(archive)) { const url = new URL(release.tarball) assert.equal(url.origin, 'https://registry.npmjs.org', 'Unexpected registry') diff --git a/refactor/scripts/releases.test.mjs b/refactor/scripts/releases.test.mjs index ec6edb8da..506131679 100644 --- a/refactor/scripts/releases.test.mjs +++ b/refactor/scripts/releases.test.mjs @@ -11,7 +11,7 @@ test('release integrity rejects corrupted bytes and inconsistent frozen digests' }) test('release cache rejects unsafe package and version path identifiers before I/O', async () => { - for (const name of ['../hls.js', '.hls', 'hls..js', 'hls/js', 'hls\\js', 'hls.js/evil', '-hls']) + for (const name of ['../hls.js', '.hls', 'hls..js', 'hls/js', 'hls\\js', 'hls.js/evil', '-hls', '@svta/../outside', '@../outside', '@svta/cml/request', '@svta\\cml-request', '@svta+cml-request', '@svta/', '@svta/.hidden']) await assert.rejects(ensureArchive({ name, version: '1.5.17' }), /Invalid release identifier/) for (const version of ['../1.5.17', '1.5.17/evil', 'latest']) await assert.rejects(ensureArchive({ name: 'hls.js', version }), /Invalid release identifier/) diff --git a/refactor/tasks.json b/refactor/tasks.json index 7356f7f18..adfb00790 100644 --- a/refactor/tasks.json +++ b/refactor/tasks.json @@ -2066,7 +2066,9 @@ "changes/2026-09-12-PKG-DASH-05-sdk-checkpoint.md", "baselines/dash-sdk.json", "baselines/dash-sdk-checkpoint.json", - "dash-validation.md" + "dash-validation.md", + "changes/2026-09-12-PKG-DASH-05-sdk-types.md", + "baselines/dash-sdk-types-validation.json" ] }, { diff --git a/refactor/third-party.json b/refactor/third-party.json index 925c7a126..51d480750 100644 --- a/refactor/third-party.json +++ b/refactor/third-party.json @@ -1049,10 +1049,12 @@ "packages/artplayer-plugin-dash-control/src/index.ts", "docs/assets/example/dash.control.js", "refactor/baselines/dash-sdk.json", - "test/browser/dash-sdk.spec.js" + "test/browser/dash-sdk.spec.js", + "refactor/baselines/dash-type-dependencies.json", + "refactor/scripts/dash-sdk-types.test.mjs" ], "contract": "Caller owns art.dash. Candidate adapts the released 4.x quality method surface and workspace 5.x stable representation ID surface. Controlled contracts and DOM validation pass; actual pinned 4.5.2/5.2.1 SDK media remains PKG-DASH-05.", - "validationStatus": "Pinned real npm 4.5.2/5.2.1, generated MPD decoding, explicit update and source replacement now exercised. DASH-SEEK-01 remains open; Windows WebKit has no MSE. SDK declarations, automatic state refresh, full formats/devices/distribution remain incomplete.", + "validationStatus": "Pinned real npm SDK 4.5.2/5.2.1 media exercised; DASH-SEEK-01 and Windows WebKit MSE gap remain. Actual SDK declarations and exact peer closure now tested across ten compiler/module configurations, with no added plugin errors and upstream-only Node10/old DOM limitations. Automatic state refresh, full formats/devices/distribution remain incomplete.", "demoPathsSource": "refactor/baselines/demo-inventory.json" }, { diff --git a/test/browser/dash-editor-types.spec.js b/test/browser/dash-editor-types.spec.js index 13f44fdc7..40a7a110a 100644 --- a/test/browser/dash-editor-types.spec.js +++ b/test/browser/dash-editor-types.spec.js @@ -34,6 +34,7 @@ const dashOption: artplayerPluginDashControl.Option = { const oldQuality: NonNullable[0]['quality']> = { getName: (value: object) => String(value) } const typedFactory: (art: Artplayer) => artplayerPluginDashControl.Result = artplayerPluginDashControl(dashOption) const defaultFactory = artplayerPluginDashControl() +const unknownTrack: artplayerPluginDashControl.AudioTrack = { id: null, index: null, lang: null } `, 'typescript', api.Uri.parse('file:///dash-consumer.ts')) const invalid = api.editor.createModel('artplayerPluginDashControl({ quality: { getName: level => level.height } })', 'typescript', api.Uri.parse('file:///dash-invalid.ts')) try { diff --git a/test/dash-lifecycle.test.js b/test/dash-lifecycle.test.js index a25669340..944439def 100644 --- a/test/dash-lifecycle.test.js +++ b/test/dash-lifecycle.test.js @@ -6,6 +6,23 @@ import { bothMenus, dashHost, dashImplementations } from './helpers/dash-control const candidates = (await dashImplementations()).filter(item => item.name.startsWith('source') || item.name.startsWith('artifact')) const { factory } = candidates[0] for (const { sdk, name, factory } of candidates) { + test(`DASH ${sdk} (${name}): nullable SDK audio metadata retains labels and original track identity`, () => { + const host = dashHost(sdk) + const track = { id: null, index: null, lang: null } + host.state.tracks = [track] + host.state.currentTrack = track + factory(bothMenus())(host.art).update() + const menu = host.controls.get('dash-audio') + assert.equal(menu.html, null) + assert.equal(menu.selector[0].default, true) + assert.equal(menu.selector[0].value, track) + host.calls.length = 0 + assert.equal(menu.onSelect(menu.selector[0]), null) + assert.equal(host.calls[0][0], 'setCurrentTrack') + assert.equal(host.calls[0][1], track) + assert.equal(host.state.currentTrack, track) + }) + test(`DASH ${sdk} (${name}): supports the original SDK method generation and stable selection keys`, () => { const host = dashHost(sdk) factory(bothMenus())(host.art).update() diff --git a/test/types/dash-control.ts b/test/types/dash-control.ts index 6855895e4..e465709c7 100644 --- a/test/types/dash-control.ts +++ b/test/types/dash-control.ts @@ -18,6 +18,7 @@ const objectConfig: Config = { getName: (item: object) => String(item) } dashControl({ quality: objectConfig, audio: objectConfig }) const level: QualityLevel = { height: 720, id: 0 } const track: AudioTrack = { id: 'en', lang: 'en' } +const unknownTrack: AudioTrack = { id: null, index: null, lang: null } interface CustomLevel { height: number, bandwidth: number } interface CustomTrack { id: number, lang: string, roles: string[] } @@ -40,4 +41,4 @@ legacy({ quality: { control: 'yes' } }) dashControl(null) // @ts-expect-error Default SDK fields cannot silently become any. dashControl({ quality: { getName: level => level.unknownProperty } }) -void [done, level, track, promise, invalidName] +void [done, level, track, unknownTrack, promise, invalidName]