screenci 0.0.75 → 0.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.d.ts +11 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +150 -37
- package/dist/cli.js.map +1 -1
- package/dist/docs/manifest.d.ts +42 -11
- package/dist/docs/manifest.d.ts.map +1 -1
- package/dist/docs/manifest.js +14 -3
- package/dist/docs/manifest.js.map +1 -1
- package/dist/docs/video-sources/installation.screenci.js +7 -9
- package/dist/docs/video-sources/installation.screenci.js.map +1 -1
- package/dist/docs/video-sources/landing.screenci.js +6 -8
- package/dist/docs/video-sources/landing.screenci.js.map +1 -1
- package/dist/docs/video-sources/locator-highlight-animated.screenci.js +3 -4
- package/dist/docs/video-sources/locator-highlight-animated.screenci.js.map +1 -1
- package/dist/docs/video-sources/locator-highlight-still.screenci.js +3 -4
- package/dist/docs/video-sources/locator-highlight-still.screenci.js.map +1 -1
- package/dist/docs/video-sources/studio.screenci.js +8 -10
- package/dist/docs/video-sources/studio.screenci.js.map +1 -1
- package/dist/e2e/instrument.e2e.js +52 -1
- package/dist/e2e/instrument.e2e.js.map +1 -1
- package/dist/index.d.ts +4 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/src/asset.d.ts +20 -1
- package/dist/src/asset.d.ts.map +1 -1
- package/dist/src/asset.js +58 -7
- package/dist/src/asset.js.map +1 -1
- package/dist/src/audio.d.ts +16 -0
- package/dist/src/audio.d.ts.map +1 -1
- package/dist/src/audio.js +78 -1
- package/dist/src/audio.js.map +1 -1
- package/dist/src/autoZoom.d.ts.map +1 -1
- package/dist/src/autoZoom.js +3 -1
- package/dist/src/autoZoom.js.map +1 -1
- package/dist/src/browserLaunchOptions.d.ts +24 -2
- package/dist/src/browserLaunchOptions.d.ts.map +1 -1
- package/dist/src/browserLaunchOptions.js +57 -3
- package/dist/src/browserLaunchOptions.js.map +1 -1
- package/dist/src/builder.d.ts +135 -142
- package/dist/src/builder.d.ts.map +1 -1
- package/dist/src/builder.js +218 -77
- package/dist/src/builder.js.map +1 -1
- package/dist/src/callerFile.d.ts +12 -0
- package/dist/src/callerFile.d.ts.map +1 -0
- package/dist/src/callerFile.js +46 -0
- package/dist/src/callerFile.js.map +1 -0
- package/dist/src/changeFocus.d.ts.map +1 -1
- package/dist/src/changeFocus.js +6 -2
- package/dist/src/changeFocus.js.map +1 -1
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +15 -0
- package/dist/src/config.js.map +1 -1
- package/dist/src/declare.d.ts +59 -0
- package/dist/src/declare.d.ts.map +1 -0
- package/dist/src/declare.js +93 -0
- package/dist/src/declare.js.map +1 -0
- package/dist/src/defaults.d.ts.map +1 -1
- package/dist/src/defaults.js +4 -3
- package/dist/src/defaults.js.map +1 -1
- package/dist/src/events.d.ts +51 -1
- package/dist/src/events.d.ts.map +1 -1
- package/dist/src/events.js +107 -15
- package/dist/src/events.js.map +1 -1
- package/dist/src/init.d.ts.map +1 -1
- package/dist/src/init.js +32 -30
- package/dist/src/init.js.map +1 -1
- package/dist/src/instrument.d.ts.map +1 -1
- package/dist/src/instrument.js +139 -1
- package/dist/src/instrument.js.map +1 -1
- package/dist/src/localize.d.ts +1 -0
- package/dist/src/localize.d.ts.map +1 -1
- package/dist/src/localize.js +1 -1
- package/dist/src/localize.js.map +1 -1
- package/dist/src/localizeRuntime.d.ts +17 -26
- package/dist/src/localizeRuntime.d.ts.map +1 -1
- package/dist/src/localizeRuntime.js +63 -48
- package/dist/src/localizeRuntime.js.map +1 -1
- package/dist/src/manualZoom.d.ts.map +1 -1
- package/dist/src/manualZoom.js +8 -5
- package/dist/src/manualZoom.js.map +1 -1
- package/dist/src/openBrowser.d.ts +34 -0
- package/dist/src/openBrowser.d.ts.map +1 -0
- package/dist/src/openBrowser.js +62 -0
- package/dist/src/openBrowser.js.map +1 -0
- package/dist/src/recordingData.d.ts +20 -0
- package/dist/src/recordingData.d.ts.map +1 -1
- package/dist/src/screenAudio.d.ts +58 -0
- package/dist/src/screenAudio.d.ts.map +1 -0
- package/dist/src/screenAudio.js +145 -0
- package/dist/src/screenAudio.js.map +1 -0
- package/dist/src/screenAudioSink.d.ts +34 -0
- package/dist/src/screenAudioSink.d.ts.map +1 -0
- package/dist/src/screenAudioSink.js +47 -0
- package/dist/src/screenAudioSink.js.map +1 -0
- package/dist/src/screenshot.d.ts +20 -24
- package/dist/src/screenshot.d.ts.map +1 -1
- package/dist/src/screenshot.js +34 -19
- package/dist/src/screenshot.js.map +1 -1
- package/dist/src/stillCapture.d.ts +5 -0
- package/dist/src/stillCapture.d.ts.map +1 -1
- package/dist/src/stillCapture.js +11 -1
- package/dist/src/stillCapture.js.map +1 -1
- package/dist/src/studio.d.ts +3 -59
- package/dist/src/studio.d.ts.map +1 -1
- package/dist/src/studio.js +1 -41
- package/dist/src/studio.js.map +1 -1
- package/dist/src/types.d.ts +133 -2
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/src/video.d.ts +63 -52
- package/dist/src/video.d.ts.map +1 -1
- package/dist/src/video.js +143 -32
- package/dist/src/video.js.map +1 -1
- package/dist/src/zoom.d.ts +1 -0
- package/dist/src/zoom.d.ts.map +1 -1
- package/dist/src/zoom.js +3 -0
- package/dist/src/zoom.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/skills/screenci/SKILL.md +2 -2
- package/skills/screenci/references/init.md +4 -3
- package/skills/screenci/references/record.md +1 -1
- package/dist/docs/video-sources/public-urls.screenci.d.ts +0 -2
- package/dist/docs/video-sources/public-urls.screenci.d.ts.map +0 -1
- package/dist/docs/video-sources/public-urls.screenci.js +0 -41
- package/dist/docs/video-sources/public-urls.screenci.js.map +0 -1
package/dist/src/builder.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import type { TestDetails, TestInfo } from '@playwright/test';
|
|
2
2
|
import type { RecordOptions } from './types.js';
|
|
3
3
|
import type { NarrationCue } from './cue.js';
|
|
4
|
-
import type { OverlayController } from './asset.js';
|
|
5
|
-
import type { AudioController } from './audio.js';
|
|
6
|
-
import type {
|
|
7
|
-
import
|
|
8
|
-
import { type
|
|
4
|
+
import type { OverlayController, OverlayControllerFor, OverlayInputOrFactory } from './asset.js';
|
|
5
|
+
import type { AudioController, AudioInput } from './audio.js';
|
|
6
|
+
import type { LocalizeNarrationValue, VoiceConfig } from './localize.js';
|
|
7
|
+
import type { Lang } from './voices.js';
|
|
8
|
+
import { type FeatureArg, type NormalizedFeature } from './declare.js';
|
|
9
9
|
/**
|
|
10
10
|
* One variant in a generic `video.each(...)` fan-out. Each variant produces a
|
|
11
11
|
* separate video (its own identity and stored history), differing only in its
|
|
12
|
-
* recording options and/or forwarded Playwright `use` options
|
|
13
|
-
* via `recordOptions.aspectRatio`, or a theme via `use.colorScheme`).
|
|
12
|
+
* recording options and/or forwarded Playwright `use` options.
|
|
14
13
|
*/
|
|
15
14
|
export type EachVariant = {
|
|
16
15
|
/** Stable label appended to the video name, e.g. `'mobile'` or `'dark'`. */
|
|
@@ -20,6 +19,26 @@ export type EachVariant = {
|
|
|
20
19
|
/** Forwarded Playwright `use` options for this variant, e.g. `{ colorScheme: 'dark' }`. */
|
|
21
20
|
use?: Record<string, unknown>;
|
|
22
21
|
};
|
|
22
|
+
/** Capture strategy across languages. */
|
|
23
|
+
export type LocalizeMode = 'shared' | 'per-language';
|
|
24
|
+
/**
|
|
25
|
+
* Recording-level localization config, declared via `video.languages(...)`. It
|
|
26
|
+
* drives the registration-time fan-out (one Playwright test per language), so it
|
|
27
|
+
* lives on a builder method rather than in `recordOptions` (a run-time option).
|
|
28
|
+
*
|
|
29
|
+
* `languages` may be `'studio'`, meaning the set is owned by the ScreenCI web app
|
|
30
|
+
* and injected at record time through the same channel as `--languages`. When the
|
|
31
|
+
* web has selected none yet, the set is empty and the render stays pending (the
|
|
32
|
+
* recording still runs so its declared schema reaches the backend to be filled).
|
|
33
|
+
*/
|
|
34
|
+
export type RecordingLocalize = {
|
|
35
|
+
languages: readonly Lang[] | 'studio';
|
|
36
|
+
mode?: LocalizeMode;
|
|
37
|
+
locales?: Partial<Record<Lang, string>>;
|
|
38
|
+
browserLocale?: boolean;
|
|
39
|
+
};
|
|
40
|
+
/** The argument accepted by `video.languages(...)`. */
|
|
41
|
+
export type LanguagesArg = 'studio' | readonly Lang[] | RecordingLocalize;
|
|
23
42
|
/** A single Playwright test to register, fully resolved from the fan-out specs. */
|
|
24
43
|
export type Registration = {
|
|
25
44
|
/** Label for the wrapping `describe` block (scopes per-test `use` options). */
|
|
@@ -28,7 +47,7 @@ export type Registration = {
|
|
|
28
47
|
leafTitle: string;
|
|
29
48
|
/** Grouping key written to `metadata.videoName`; shared across a video's languages. */
|
|
30
49
|
videoName: string;
|
|
31
|
-
/** Active language for this pass, or `null` in shared /
|
|
50
|
+
/** Active language for this pass, or `null` in shared / single-language mode. */
|
|
32
51
|
language: string | null;
|
|
33
52
|
/** Browser locale for this pass, or `null` to leave the default. */
|
|
34
53
|
locale: string | null;
|
|
@@ -36,29 +55,57 @@ export type Registration = {
|
|
|
36
55
|
recordOptions: Partial<RecordOptions> | null;
|
|
37
56
|
/** Forwarded Playwright `use` options for this pass, or `null` for none. */
|
|
38
57
|
use: Record<string, unknown> | null;
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
58
|
+
/** Per-feature declarations carried into the fixtures. */
|
|
59
|
+
narration: NormalizedFeature<LocalizeNarrationValue> | null;
|
|
60
|
+
text: NormalizedFeature<string> | null;
|
|
61
|
+
overlays: NormalizedFeature<OverlayInputOrFactory> | null;
|
|
62
|
+
audio: NormalizedFeature<AudioInput> | null;
|
|
63
|
+
/** Resolved recording-level localize config (languages/mode/locales). */
|
|
64
|
+
recordingLocalize: ResolvedRecordingLocalize;
|
|
43
65
|
};
|
|
66
|
+
/** The recording-level localize config after registration-time resolution. */
|
|
67
|
+
export type ResolvedRecordingLocalize = {
|
|
68
|
+
/** Every language this video records (the resolved set). */
|
|
69
|
+
languages: string[];
|
|
70
|
+
mode: LocalizeMode;
|
|
71
|
+
browserLocale: boolean;
|
|
72
|
+
locales?: Partial<Record<Lang, string>>;
|
|
73
|
+
/** Whether the set is owned by the web app (`video.languages('studio')`). */
|
|
74
|
+
studioOwned: boolean;
|
|
75
|
+
/** Studio-owned set with nothing selected yet: record for metadata, do not render. */
|
|
76
|
+
pending: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Whether the languages were explicitly declared (via `video.languages(...)`,
|
|
79
|
+
* `'studio'`, or per-feature keys) rather than the implicit `['en']` default. A
|
|
80
|
+
* plain video with no language info stays language-agnostic (no `[lang]` tag).
|
|
81
|
+
*/
|
|
82
|
+
explicit: boolean;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Resolve the recorded language set at registration time. Priority:
|
|
86
|
+
* 1. `video.languages('studio')` -> the web-owned set, injected via the
|
|
87
|
+
* `--languages` channel (`requestedLanguages`); empty => pending.
|
|
88
|
+
* 2. explicit `video.languages([...])`.
|
|
89
|
+
* 3. union of per-feature language keys (e.g. `narration({ fr })` -> French).
|
|
90
|
+
* 4. default `['en']`.
|
|
91
|
+
* The `requestedLanguages` filter (CLI / studio injection) intersects 2-4.
|
|
92
|
+
*/
|
|
93
|
+
export declare function resolveRecordingLocalize(state: BuilderState, requestedLanguages: string[] | null): ResolvedRecordingLocalize;
|
|
44
94
|
/**
|
|
45
|
-
* Expand the
|
|
46
|
-
*
|
|
95
|
+
* Expand the fan-out specs into the concrete list of Playwright tests to
|
|
96
|
+
* register. Pure and exported for testing.
|
|
47
97
|
*
|
|
48
|
-
* -
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* a shared recording.
|
|
52
|
-
* -
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* per language unless `browserLocale` is `false`.
|
|
98
|
+
* - A single resolved language (default, or one inferred/declared) yields one
|
|
99
|
+
* language-agnostic test (`language: null`).
|
|
100
|
+
* - `'shared'` mode yields one test carrying every language (overdubbed at
|
|
101
|
+
* render); the `--languages` filter does not split a shared recording.
|
|
102
|
+
* - `'per-language'` mode yields one test per resolved language.
|
|
103
|
+
* - A studio-owned set with nothing selected yet yields one pending test that
|
|
104
|
+
* records (so its schema reaches the backend) but renders nothing.
|
|
56
105
|
*/
|
|
57
106
|
export declare function expandRegistrations(params: {
|
|
58
107
|
baseTitle: string;
|
|
59
|
-
|
|
60
|
-
studio: StudioDeclaration | null;
|
|
61
|
-
eachVariants: EachVariant[] | null;
|
|
108
|
+
state: BuilderState;
|
|
62
109
|
requestedLanguages: string[] | null;
|
|
63
110
|
}): Registration[];
|
|
64
111
|
type TestCall = {
|
|
@@ -74,141 +121,87 @@ type RegistrarTest = TestCall & {
|
|
|
74
121
|
fixme: TestCall;
|
|
75
122
|
fail: TestCall;
|
|
76
123
|
};
|
|
77
|
-
/** Converts a union type to an intersection: `A | B` -> `A & B`. */
|
|
78
|
-
type UnionToIntersection<U> = (U extends unknown ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
|
79
|
-
/**
|
|
80
|
-
* Union of every inner key across all languages of a seeded map `M` (e.g. the
|
|
81
|
-
* cue names of `{ en: { intro, save }, fi: { intro, save } }`). Uses each
|
|
82
|
-
* language's key set before intersecting, so each language must cover the union
|
|
83
|
-
* (the identical-keys guarantee, enforced via {@link EnforceIdenticalKeys}).
|
|
84
|
-
*/
|
|
85
|
-
type SeededKeys<M> = [M] extends [object] ? Extract<keyof UnionToIntersection<{
|
|
86
|
-
[L in keyof M]-?: NonNullable<M[L]> extends Record<string, unknown> ? Record<keyof NonNullable<M[L]> & string, unknown> : never;
|
|
87
|
-
}[keyof M]>, string> : never;
|
|
88
|
-
/** Studio-managed names from a `video.studio({...})` name list. */
|
|
89
|
-
type StudioNamesOf<N> = N extends readonly string[] ? N[number] : never;
|
|
90
|
-
/** Seeded cue names (declared in the per-language `narration` map). */
|
|
91
|
-
type CueNamesOf<S> = S extends {
|
|
92
|
-
narration: infer M;
|
|
93
|
-
} ? SeededKeys<M> : never;
|
|
94
|
-
/** Seeded `text` field names (declared in the per-language `text` map). */
|
|
95
|
-
type FieldNamesOf<S> = S extends {
|
|
96
|
-
text: infer T;
|
|
97
|
-
} ? SeededKeys<T> : never;
|
|
98
124
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
* so it is rejected as excess.
|
|
125
|
+
* The content names declared by a {@link FeatureArg}. Array elements for the
|
|
126
|
+
* studio form; for objects, the union of content-major top-level keys (those that
|
|
127
|
+
* are not language codes or `default`) and the language-major inner keys.
|
|
103
128
|
*/
|
|
104
|
-
type
|
|
105
|
-
|
|
129
|
+
type LangKey = Lang | 'default';
|
|
130
|
+
type LangMajorNamesOf<A> = NonNullable<{
|
|
131
|
+
[K in keyof A & LangKey]: A[K] extends Record<string, unknown> ? Extract<keyof A[K], string> : never;
|
|
132
|
+
}[keyof A & LangKey]>;
|
|
133
|
+
export type FeatureNamesOf<A> = A extends readonly string[] ? A[number] : A extends object ? Extract<Exclude<keyof A, LangKey>, string> | LangMajorNamesOf<A> : never;
|
|
134
|
+
/** The overlay controller type for a single declared name. */
|
|
135
|
+
type OverlayControllerForName<A, K extends string> = A extends readonly string[] ? OverlayController : K extends keyof A ? OverlayControllerFor<A[K]> : OverlayController;
|
|
136
|
+
type NarrationOverrideFor<Args, A> = 'narration' extends keyof Args ? [FeatureNamesOf<A>] extends [never] ? object : {
|
|
137
|
+
narration: Record<FeatureNamesOf<A>, NarrationCue>;
|
|
138
|
+
} : object;
|
|
139
|
+
type TextOverrideFor<Args, A> = 'text' extends keyof Args ? [FeatureNamesOf<A>] extends [never] ? object : {
|
|
140
|
+
text: Record<FeatureNamesOf<A>, string>;
|
|
141
|
+
} : object;
|
|
142
|
+
type OverlayOverrideFor<Args, A> = 'overlays' extends keyof Args ? [FeatureNamesOf<A>] extends [never] ? object : {
|
|
143
|
+
overlays: {
|
|
144
|
+
[K in FeatureNamesOf<A>]: OverlayControllerForName<A, K>;
|
|
145
|
+
};
|
|
146
|
+
} : object;
|
|
147
|
+
type AudioOverrideFor<Args, A> = 'audio' extends keyof Args ? [FeatureNamesOf<A>] extends [never] ? object : {
|
|
148
|
+
audio: Record<FeatureNamesOf<A>, AudioController>;
|
|
149
|
+
} : object;
|
|
150
|
+
type MergeArgs<Args, O> = {
|
|
151
|
+
[K in keyof Args | keyof O]: K extends keyof O ? O[K] : K extends keyof Args ? Args[K] : never;
|
|
106
152
|
};
|
|
107
|
-
/**
|
|
108
|
-
* Refines a localize spec so its `narration`/`text` maps have identical keys
|
|
109
|
-
* across languages. Intersected with the inferred spec `S` at the `.localize`
|
|
110
|
-
* call site so a dropped per-language key is a compile error.
|
|
111
|
-
*/
|
|
112
|
-
type ValidateLocalizeSpec<S> = (S extends {
|
|
113
|
-
narration: infer M;
|
|
114
|
-
} ? {
|
|
115
|
-
narration: EnforceIdenticalKeys<M, LocalizeNarrationValue>;
|
|
116
|
-
} : object) & (S extends {
|
|
117
|
-
text: infer T;
|
|
118
|
-
} ? {
|
|
119
|
-
text: EnforceIdenticalKeys<T, string>;
|
|
120
|
-
} : object);
|
|
121
|
-
type NarrationOverrideFor<S> = [CueNamesOf<S>] extends [never] ? NarrationMarkers : Record<CueNamesOf<S>, NarrationCue>;
|
|
122
|
-
/**
|
|
123
|
-
* The `text` fixture type for a spec: every field is a `string`. A seeded field
|
|
124
|
-
* carries its per-language value; a Studio-managed field (`studio.text`) is the
|
|
125
|
-
* empty string until it is set in Studio (the recording still succeeds). In
|
|
126
|
-
* `shared` mode there is no per-language injection, so seeded fields are also
|
|
127
|
-
* empty until provided.
|
|
128
|
-
*/
|
|
129
|
-
type TextOverrideFor<S> = [FieldNamesOf<S>] extends [never] ? TextValues : Record<FieldNamesOf<S>, string>;
|
|
130
|
-
/**
|
|
131
|
-
* The fixture arg overrides a `localize(spec)` contributes: `narration` typed to
|
|
132
|
-
* the spec's cue names (only when the medium has narration) and `text` typed to
|
|
133
|
-
* its field names. Keys absent from `Args` (e.g. `narration` on a screenshot)
|
|
134
|
-
* are not added.
|
|
135
|
-
*/
|
|
136
|
-
type LocalizeOverrides<Args, S> = ('narration' extends keyof Args ? {
|
|
137
|
-
narration: NarrationOverrideFor<S>;
|
|
138
|
-
} : object) & ('text' extends keyof Args ? {
|
|
139
|
-
text: TextOverrideFor<S>;
|
|
140
|
-
} : object);
|
|
141
|
-
/** Studio-managed names of each kind declared in a `video.studio({...})` spec. */
|
|
142
|
-
type StudioNarrationNamesOf<SD> = SD extends {
|
|
143
|
-
narration: infer N;
|
|
144
|
-
} ? StudioNamesOf<N> : never;
|
|
145
|
-
type StudioTextNamesOf<SD> = SD extends {
|
|
146
|
-
text: infer N;
|
|
147
|
-
} ? StudioNamesOf<N> : never;
|
|
148
|
-
type StudioOverlayNamesOf<SD> = SD extends {
|
|
149
|
-
overlays: infer N;
|
|
150
|
-
} ? StudioNamesOf<N> : never;
|
|
151
|
-
type StudioAudioNamesOf<SD> = SD extends {
|
|
152
|
-
audio: infer N;
|
|
153
|
-
} ? StudioNamesOf<N> : never;
|
|
154
|
-
/**
|
|
155
|
-
* The fixture arg overrides a `studio(decl)` contributes: each declared name
|
|
156
|
-
* list types its fixture (`narration`/`text`/`overlays`/`audio`) to the exact
|
|
157
|
-
* names so a typo is a compile error. Keys absent from `Args` (e.g. `narration`
|
|
158
|
-
* on a screenshot) or kinds not declared are not added. When combined with
|
|
159
|
-
* `localize(...)`, the per-fixture records intersect, unioning the names.
|
|
160
|
-
*/
|
|
161
|
-
type StudioOverrides<Args, SD> = ('narration' extends keyof Args ? [StudioNarrationNamesOf<SD>] extends [never] ? object : {
|
|
162
|
-
narration: Record<StudioNarrationNamesOf<SD>, NarrationCue>;
|
|
163
|
-
} : object) & ('text' extends keyof Args ? [StudioTextNamesOf<SD>] extends [never] ? object : {
|
|
164
|
-
text: Record<StudioTextNamesOf<SD>, string>;
|
|
165
|
-
} : object) & ('overlays' extends keyof Args ? [StudioOverlayNamesOf<SD>] extends [never] ? object : {
|
|
166
|
-
overlays: Record<StudioOverlayNamesOf<SD>, OverlayController>;
|
|
167
|
-
} : object) & ('audio' extends keyof Args ? [StudioAudioNamesOf<SD>] extends [never] ? object : {
|
|
168
|
-
audio: Record<StudioAudioNamesOf<SD>, AudioController>;
|
|
169
|
-
} : object);
|
|
170
|
-
type MergeArgs<Args, O> = Omit<Args, keyof O> & O;
|
|
171
153
|
type BodyFn<Args> = (args: Args, testInfo: TestInfo) => void | Promise<void>;
|
|
172
154
|
/**
|
|
173
|
-
* A chainable fan-out builder. Callable to register the test(s), and exposes
|
|
174
|
-
* `.
|
|
175
|
-
* accumulates the typed fixture overrides
|
|
176
|
-
* `narration`/`text` typed to the
|
|
155
|
+
* A chainable fan-out builder. Callable to register the test(s), and exposes the
|
|
156
|
+
* per-feature declaration methods plus `.languages()` / `.each()` to refine the
|
|
157
|
+
* fan-out. `O` accumulates the typed fixture overrides so the body sees
|
|
158
|
+
* `narration`/`text`/`overlays`/`audio` typed to the declared names.
|
|
177
159
|
*/
|
|
178
160
|
type BuilderTerminal<Args, O> = {
|
|
179
161
|
(title: string, body: BodyFn<MergeArgs<Args, O>>): void;
|
|
180
162
|
(title: string, details: TestDetails, body: BodyFn<MergeArgs<Args, O>>): void;
|
|
181
163
|
};
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
164
|
+
/** The fixture keys a medium supports (videos: all; screenshots: text+overlays). */
|
|
165
|
+
export type FeatureKey = 'narration' | 'text' | 'overlays' | 'audio';
|
|
166
|
+
export interface MediaBuilder<Args, O = object> extends BuilderTerminal<Args, O> {
|
|
167
|
+
/** Declare narration cues: Studio-owned (array) or code values (object). */
|
|
168
|
+
narration<const A extends FeatureArg<LocalizeNarrationValue>>(arg: A): MediaBuilder<Args, O & NarrationOverrideFor<Args, A>>;
|
|
169
|
+
/** Declare on-screen text fields. */
|
|
170
|
+
text<const A extends FeatureArg<string>>(arg: A): MediaBuilder<Args, O & TextOverrideFor<Args, A>>;
|
|
171
|
+
/** Declare overlays. */
|
|
172
|
+
overlays<const A extends FeatureArg<OverlayInputOrFactory>>(arg: A): MediaBuilder<Args, O & OverlayOverrideFor<Args, A>>;
|
|
173
|
+
/** Declare background-audio tracks. */
|
|
174
|
+
audio<const A extends FeatureArg<AudioInput>>(arg: A): MediaBuilder<Args, O & AudioOverrideFor<Args, A>>;
|
|
175
|
+
/** Declare the recorded language set / capture mode. */
|
|
176
|
+
languages(arg: LanguagesArg): MediaBuilder<Args, O>;
|
|
191
177
|
/** Produce a separate video per variant (viewport, theme, ...). */
|
|
192
|
-
each(variants: EachVariant[]):
|
|
193
|
-
/** Register the localized test(s) with `test.only`. */
|
|
178
|
+
each(variants: EachVariant[]): MediaBuilder<Args, O>;
|
|
194
179
|
only: BuilderTerminal<Args, O>;
|
|
195
|
-
/** Register the localized test(s) with `test.skip`. */
|
|
196
180
|
skip: BuilderTerminal<Args, O>;
|
|
197
|
-
/** Register the localized test(s) with `test.fixme`. */
|
|
198
181
|
fixme: BuilderTerminal<Args, O>;
|
|
199
|
-
/** Register the localized test(s) with `test.fail`. */
|
|
200
182
|
fail: BuilderTerminal<Args, O>;
|
|
201
183
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
184
|
+
/** Backwards-compatible alias used by the video/screenshot entry points. */
|
|
185
|
+
export type VideoBuilder<Args, O = object> = MediaBuilder<Args, O>;
|
|
186
|
+
export type BuilderState = {
|
|
187
|
+
narration: NormalizedFeature<LocalizeNarrationValue> | null;
|
|
188
|
+
text: NormalizedFeature<string> | null;
|
|
189
|
+
overlays: NormalizedFeature<OverlayInputOrFactory> | null;
|
|
190
|
+
audio: NormalizedFeature<AudioInput> | null;
|
|
191
|
+
recordingLocalize: RecordingLocalize | null;
|
|
205
192
|
eachVariants: EachVariant[] | null;
|
|
193
|
+
/** Fixtures this medium supports; declaring an unsupported one throws. */
|
|
194
|
+
features: ReadonlySet<FeatureKey>;
|
|
206
195
|
};
|
|
196
|
+
/** The full set of feature fixtures for videos. */
|
|
197
|
+
export declare const VIDEO_FEATURES: ReadonlySet<FeatureKey>;
|
|
198
|
+
/** Stills are silent: only text + overlays. */
|
|
199
|
+
export declare const SCREENSHOT_FEATURES: ReadonlySet<FeatureKey>;
|
|
207
200
|
/**
|
|
208
|
-
* Create a fan-out builder bound to a registrar test instance. `
|
|
209
|
-
*
|
|
210
|
-
*
|
|
201
|
+
* Create a fan-out builder bound to a registrar test instance. `Args` is the
|
|
202
|
+
* medium's fixture arg type (video/screenshot); `features` selects which
|
|
203
|
+
* per-feature methods are valid for the medium.
|
|
211
204
|
*/
|
|
212
|
-
export declare function createVideoBuilder<Args>(test: RegistrarTest, state?: BuilderState):
|
|
213
|
-
export {};
|
|
205
|
+
export declare function createVideoBuilder<Args>(test: RegistrarTest, features?: ReadonlySet<FeatureKey>, state?: BuilderState): MediaBuilder<Args>;
|
|
206
|
+
export type { VoiceConfig };
|
|
214
207
|
//# sourceMappingURL=builder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAA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