@hackbuild/ai-views 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,92 @@
1
+ /**
2
+ * The state behind TranscribeDrop and TranscriptView: drop files, they queue as channels, run one at a
3
+ * time, and each becomes a transcript with timestamps that a person can
4
+ * edit (with undo) and export as txt, srt, vtt or json. The engine is a
5
+ * function the page passes, so a stub runs the view with no weights.
6
+ */
7
+ import { type Dropped, type Seg } from "@hackbuild/transcribe";
8
+ import { type StripFigure, type StripStatus } from "@virgilvox/hackbuild-ui/vanilla";
9
+ /** What a transcriber returns: segments, dropped lines, duration, language and model. */
10
+ export interface RunResult {
11
+ segments: Seg[];
12
+ dropped?: Dropped[];
13
+ /** Seconds of audio. */
14
+ duration?: number;
15
+ language?: string;
16
+ model?: string;
17
+ }
18
+ /** What a transcriber gets: an abort signal and a progress callback. */
19
+ export interface RunContext {
20
+ signal: AbortSignal;
21
+ /** 0 to 1. */
22
+ onProgress: (fraction: number) => void;
23
+ }
24
+ /** Turns one file into a transcript. A page wires @hackbuild/transcribe here; a stub needs none. */
25
+ export type Transcriber = (file: Blob & {
26
+ name: string;
27
+ }, ctx: RunContext) => Promise<RunResult>;
28
+ /**
29
+ * One file in a transcribe queue: name, size, status, progress, segments, dropped lines and the
30
+ * error if it failed.
31
+ */
32
+ export interface Channel {
33
+ id: number;
34
+ name: string;
35
+ size: number;
36
+ status: StripStatus;
37
+ /** 0 to 100 while running. */
38
+ pct: number;
39
+ segments: Seg[];
40
+ dropped: Dropped[];
41
+ duration?: number;
42
+ language?: string;
43
+ model?: string;
44
+ error?: string;
45
+ meta: StripFigure[];
46
+ }
47
+ /** A transcript export format: txt, srt, vtt or json. */
48
+ export type ExportKind = "txt" | "srt" | "vtt" | "json";
49
+ /** What a transcribe queue shows: channels, the selected one, whether it runs, and undo state. */
50
+ export interface QueueSnapshot {
51
+ channels: readonly Channel[];
52
+ selected: number | null;
53
+ running: boolean;
54
+ canUndo: boolean;
55
+ canRedo: boolean;
56
+ }
57
+ /**
58
+ * A transcribe queue: add files, start and stop, select, edit lines with undo, and export a channel
59
+ * as txt, srt, vtt or json.
60
+ */
61
+ export interface TranscribeQueue {
62
+ snapshot(): QueueSnapshot;
63
+ subscribe(fn: (s: QueueSnapshot) => void): () => void;
64
+ /** Queue files; starts the run unless `autostart` is off. */
65
+ add(files: Iterable<Blob & {
66
+ name: string;
67
+ }>): void;
68
+ start(): Promise<void>;
69
+ stop(): void;
70
+ remove(id: number): void;
71
+ clear(): void;
72
+ select(id: number): void;
73
+ /** Change one line's text or speaker; one undo step. */
74
+ edit(id: number, index: number, patch: {
75
+ text?: string;
76
+ speaker?: string;
77
+ }): void;
78
+ undo(): void;
79
+ redo(): void;
80
+ /** One channel as a file: its name, text and media type. */
81
+ exportAs(kind: ExportKind, id?: number): {
82
+ name: string;
83
+ text: string;
84
+ type: string;
85
+ } | null;
86
+ setTranscriber(t: Transcriber): void;
87
+ }
88
+ /** Creates a transcribe queue that runs each file through `run`, one at a time. */
89
+ export declare function transcribeQueue(o: {
90
+ run: Transcriber;
91
+ autostart?: boolean;
92
+ }): TranscribeQueue;
@@ -0,0 +1,175 @@
1
+ /**
2
+ * The state behind TranscribeDrop and TranscriptView: drop files, they queue as channels, run one at a
3
+ * time, and each becomes a transcript with timestamps that a person can
4
+ * edit (with undo) and export as txt, srt, vtt or json. The engine is a
5
+ * function the page passes, so a stub runs the view with no weights.
6
+ */
7
+ import { asJson, asSrt, asTxt, asVtt, baseName } from "@hackbuild/transcribe";
8
+ import { stripMeta } from "@virgilvox/hackbuild-ui/vanilla";
9
+ const TYPES = { txt: "text/plain", srt: "application/x-subrip", vtt: "text/vtt", json: "application/json" };
10
+ /** Creates a transcribe queue that runs each file through `run`, one at a time. */
11
+ export function transcribeQueue(o) {
12
+ let run = o.run;
13
+ let channels = [];
14
+ const files = new Map();
15
+ let selected = null;
16
+ let running = false;
17
+ let ac = null;
18
+ let seq = 0;
19
+ const undo = [];
20
+ const redo = [];
21
+ const subs = new Set();
22
+ const snap = () => ({ channels, selected, running, canUndo: undo.length > 0, canRedo: redo.length > 0 });
23
+ const emit = () => {
24
+ const s = snap();
25
+ for (const fn of subs)
26
+ fn(s);
27
+ };
28
+ const patch = (id, p) => {
29
+ channels = channels.map((c) => (c.id === id ? { ...c, ...p } : c));
30
+ emit();
31
+ };
32
+ const metaOf = (c) => stripMeta({ size: c.size, ...(c.duration ? { duration: c.duration } : {}), ...(c.status === "done" ? { lines: c.segments.length } : {}) });
33
+ const q = {
34
+ snapshot: snap,
35
+ subscribe(fn) {
36
+ subs.add(fn);
37
+ fn(snap());
38
+ return () => subs.delete(fn);
39
+ },
40
+ add(list) {
41
+ for (const f of list) {
42
+ const id = ++seq;
43
+ files.set(id, f);
44
+ const c = { id, name: f.name, size: f.size, status: "queued", pct: 0, segments: [], dropped: [], meta: [] };
45
+ c.meta = metaOf(c);
46
+ channels = [...channels, c];
47
+ if (selected === null)
48
+ selected = id;
49
+ }
50
+ emit();
51
+ if (o.autostart !== false)
52
+ void q.start();
53
+ },
54
+ async start() {
55
+ if (running)
56
+ return;
57
+ running = true;
58
+ emit();
59
+ for (;;) {
60
+ const next = channels.find((c) => c.status === "queued");
61
+ if (!next || !running)
62
+ break;
63
+ const file = files.get(next.id);
64
+ ac = new AbortController();
65
+ patch(next.id, { status: "working", pct: 0 });
66
+ try {
67
+ const r = await run(file, { signal: ac.signal, onProgress: (f) => patch(next.id, { pct: Math.round(Math.min(1, Math.max(0, f)) * 100) }) });
68
+ const c = channels.find((x) => x.id === next.id);
69
+ if (!c)
70
+ continue;
71
+ const done = { ...c, status: r.segments.length ? "done" : "empty", pct: 100, segments: r.segments, dropped: r.dropped ?? [] };
72
+ if (r.duration !== undefined)
73
+ done.duration = r.duration;
74
+ if (r.language)
75
+ done.language = r.language;
76
+ if (r.model)
77
+ done.model = r.model;
78
+ done.meta = metaOf(done);
79
+ patch(next.id, done);
80
+ if (selected === null || channels.find((x) => x.id === selected)?.status !== "done")
81
+ selected = next.id;
82
+ }
83
+ catch (e) {
84
+ const stopped = ac.signal.aborted;
85
+ patch(next.id, stopped ? { status: "queued", pct: 0 } : { status: "failed", error: e instanceof Error ? e.message : String(e) });
86
+ if (stopped)
87
+ break;
88
+ }
89
+ }
90
+ running = false;
91
+ ac = null;
92
+ emit();
93
+ },
94
+ stop() {
95
+ running = false;
96
+ ac?.abort();
97
+ emit();
98
+ },
99
+ remove(id) {
100
+ if (channels.find((c) => c.id === id)?.status === "working")
101
+ ac?.abort();
102
+ channels = channels.filter((c) => c.id !== id);
103
+ files.delete(id);
104
+ if (selected === id)
105
+ selected = channels[0]?.id ?? null;
106
+ emit();
107
+ },
108
+ clear() {
109
+ q.stop();
110
+ channels = [];
111
+ files.clear();
112
+ selected = null;
113
+ undo.length = 0;
114
+ redo.length = 0;
115
+ emit();
116
+ },
117
+ select(id) {
118
+ selected = id;
119
+ emit();
120
+ },
121
+ edit(id, index, p) {
122
+ const c = channels.find((x) => x.id === id);
123
+ const seg = c?.segments[index];
124
+ if (!c || !seg)
125
+ return;
126
+ const next = { ...seg, edited: true };
127
+ if (p.text !== undefined)
128
+ next.text = p.text;
129
+ if (p.speaker !== undefined) {
130
+ if (p.speaker)
131
+ next.speaker = p.speaker;
132
+ else
133
+ delete next.speaker;
134
+ }
135
+ if (next.text === seg.text && next.speaker === seg.speaker)
136
+ return;
137
+ undo.push({ id, segments: c.segments });
138
+ redo.length = 0;
139
+ patch(id, { segments: c.segments.map((s, i) => (i === index ? next : s)) });
140
+ },
141
+ undo() {
142
+ const u = undo.pop();
143
+ const c = u && channels.find((x) => x.id === u.id);
144
+ if (!u || !c)
145
+ return emit();
146
+ redo.push({ id: u.id, segments: c.segments });
147
+ patch(u.id, { segments: u.segments });
148
+ },
149
+ redo() {
150
+ const r = redo.pop();
151
+ const c = r && channels.find((x) => x.id === r.id);
152
+ if (!r || !c)
153
+ return emit();
154
+ undo.push({ id: r.id, segments: c.segments });
155
+ patch(r.id, { segments: r.segments });
156
+ },
157
+ exportAs(kind, id = selected ?? -1) {
158
+ const c = channels.find((x) => x.id === id);
159
+ if (!c || !c.segments.length)
160
+ return null;
161
+ const text = kind === "txt"
162
+ ? asTxt(c.segments)
163
+ : kind === "srt"
164
+ ? asSrt(c.segments)
165
+ : kind === "vtt"
166
+ ? asVtt(c.segments)
167
+ : asJson({ source: c.name, segments: c.segments, dropped: c.dropped, model: c.model ?? "unknown", language: c.language ?? "unknown", ...(c.duration !== undefined ? { duration: c.duration } : {}) });
168
+ return { name: `${baseName(c.name)}.${kind}`, text, type: TYPES[kind] };
169
+ },
170
+ setTranscriber(t) {
171
+ run = t;
172
+ },
173
+ };
174
+ return q;
175
+ }
package/dist/vue.d.ts ADDED
@@ -0,0 +1,281 @@
1
+ /**
2
+ * @hackbuild/ai-views/vue: the views as Vue 3 components. Each one mounts
3
+ * the same function the custom element does on a host that shows as
4
+ * `.hb-view` (display contents), so the look is one code path; props in, events out.
5
+ * Vue is an optional peer: only this entry imports it.
6
+ */
7
+ import { type PropType } from "vue";
8
+ import type { Env } from "@hackbuild/ai-env";
9
+ import type { ChatList as ChatListState, ChatThread } from "./chat.js";
10
+ import type { Job } from "./jobs.js";
11
+ import { type JobsPick, type Loader, type ModelPick } from "./pick.js";
12
+ import type { TranscribeQueue as Queue } from "./transcribe.js";
13
+ import type { FrameResults } from "./frame.js";
14
+ import { type MaskModels, type MaskStudio as Studio } from "./mount-mask.js";
15
+ import { type RecallLike } from "./memory.js";
16
+ /** Vue component for a model picker of one job; emits `pick`, `choose`, `loaded` and `failed`. */
17
+ export declare const ModelSelect: import("vue").DefineComponent<{
18
+ job: Job;
19
+ pick?: ModelPick | undefined;
20
+ variant: "line" | "chip";
21
+ go: boolean;
22
+ env?: Env | undefined;
23
+ loader?: Loader | undefined;
24
+ }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
25
+ [key: string]: any;
26
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("choose" | "failed" | "loaded" | "pick")[], "choose" | "failed" | "loaded" | "pick", import("vue").PublicProps, Readonly<{
27
+ job: Job;
28
+ pick?: ModelPick | undefined;
29
+ variant: "line" | "chip";
30
+ go: boolean;
31
+ env?: Env | undefined;
32
+ loader?: Loader | undefined;
33
+ }> & Readonly<{
34
+ onChoose?: (...args: any[]) => any;
35
+ onFailed?: (...args: any[]) => any;
36
+ onLoaded?: (...args: any[]) => any;
37
+ onPick?: (...args: any[]) => any;
38
+ }>, {
39
+ job: Job;
40
+ pick: ModelPick;
41
+ variant: "chip" | "line";
42
+ go: boolean;
43
+ env: Env;
44
+ loader: Loader;
45
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
46
+ /** Vue component for the turns of a chat thread. */
47
+ export declare const ChatPane: import("vue").DefineComponent<{
48
+ thread: ChatThread;
49
+ name: string;
50
+ emptyName: string;
51
+ emptyNote: string;
52
+ }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
53
+ [key: string]: any;
54
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
55
+ thread: ChatThread;
56
+ name: string;
57
+ emptyName: string;
58
+ emptyNote: string;
59
+ }> & Readonly<{}>, {
60
+ name: string;
61
+ emptyName: string;
62
+ emptyNote: string;
63
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
64
+ /** Vue component for the message box of a chat thread. */
65
+ export declare const Composer: import("vue").DefineComponent<{
66
+ thread: ChatThread;
67
+ placeholder: string;
68
+ }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
69
+ [key: string]: any;
70
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
71
+ thread: ChatThread;
72
+ placeholder: string;
73
+ }> & Readonly<{}>, {
74
+ placeholder: string;
75
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
76
+ /** Vue component for the drop zone that becomes the transcript; emits `sample`. */
77
+ export declare const TranscribeDrop: import("vue").DefineComponent<{
78
+ queue: Queue;
79
+ accept: string;
80
+ sampleLabel: string;
81
+ }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
82
+ [key: string]: any;
83
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "sample"[], "sample", import("vue").PublicProps, Readonly<{
84
+ queue: Queue;
85
+ accept: string;
86
+ sampleLabel: string;
87
+ }> & Readonly<{
88
+ onSample?: (...args: any[]) => any;
89
+ }>, {
90
+ accept: string;
91
+ sampleLabel: string;
92
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
93
+ /** Vue component for the selected transcript, or its export buttons when `exports` is set. */
94
+ export declare const TranscriptView: import("vue").DefineComponent<{
95
+ queue: Queue;
96
+ exports: boolean;
97
+ }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
98
+ [key: string]: any;
99
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
100
+ queue: Queue;
101
+ exports: boolean;
102
+ }> & Readonly<{}>, {
103
+ exports: boolean;
104
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
105
+ /**
106
+ * Vue component for a mask studio; emits `studio` with the mounted studio and `sample` when the
107
+ * sample button is pressed.
108
+ */
109
+ export declare const MaskStudio: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
110
+ models: {
111
+ type: PropType<MaskModels>;
112
+ default: () => {};
113
+ };
114
+ sampleLabel: {
115
+ type: StringConstructor;
116
+ default: string;
117
+ };
118
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
119
+ [key: string]: any;
120
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("sample" | "studio")[], "sample" | "studio", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
121
+ models: {
122
+ type: PropType<MaskModels>;
123
+ default: () => {};
124
+ };
125
+ sampleLabel: {
126
+ type: StringConstructor;
127
+ default: string;
128
+ };
129
+ }>> & Readonly<{
130
+ onSample?: (...args: any[]) => any;
131
+ onStudio?: (...args: any[]) => any;
132
+ }>, {
133
+ models: MaskModels;
134
+ sampleLabel: string;
135
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
136
+ /** Vue component for the tool rail of a mask studio. */
137
+ export declare const MaskTools: import("vue").DefineComponent<{
138
+ studio: Studio;
139
+ }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
140
+ [key: string]: any;
141
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
142
+ studio: Studio;
143
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
144
+ /** Vue component for the undo, redo and zoom row of a mask studio. */
145
+ export declare const MaskVerbs: import("vue").DefineComponent<{
146
+ studio: Studio;
147
+ }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
148
+ [key: string]: any;
149
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
150
+ studio: Studio;
151
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
152
+ /** Vue component for one rack part of a mask studio: found, mask, saved or export. */
153
+ export declare const MaskRack: import("vue").DefineComponent<{
154
+ studio: Studio;
155
+ part: "found" | "mask" | "saved" | "export";
156
+ name: string;
157
+ }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
158
+ [key: string]: any;
159
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
160
+ studio: Studio;
161
+ part: "found" | "mask" | "saved" | "export";
162
+ name: string;
163
+ }> & Readonly<{}>, {
164
+ part: "export" | "found" | "mask" | "saved";
165
+ name: string;
166
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
167
+ /** Vue component for a jobs rack: a line per job, presets and load all. */
168
+ export declare const ModelJobs: import("vue").DefineComponent<{
169
+ jobs: JobsPick;
170
+ go: boolean;
171
+ }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
172
+ [key: string]: any;
173
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
174
+ jobs: JobsPick;
175
+ go: boolean;
176
+ }> & Readonly<{}>, {
177
+ go: boolean;
178
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
179
+ /** Vue component for the file list of a transcribe queue. */
180
+ export declare const TranscribeQueue: import("vue").DefineComponent<{
181
+ queue: Queue;
182
+ }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
183
+ [key: string]: any;
184
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
185
+ queue: Queue;
186
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
187
+ /** Vue component that shows a recall trace as a table. */
188
+ export declare const MemoryInspector: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
189
+ recall: {
190
+ type: PropType<RecallLike | null>;
191
+ default: null;
192
+ };
193
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
194
+ [key: string]: any;
195
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
196
+ recall: {
197
+ type: PropType<RecallLike | null>;
198
+ default: null;
199
+ };
200
+ }>> & Readonly<{}>, {
201
+ recall: RecallLike | null;
202
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
203
+ /** Vue component for the chat list rail of a `chatList`. */
204
+ export declare const ChatList: import("vue").DefineComponent<{
205
+ list: ChatListState;
206
+ label: string;
207
+ }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
208
+ [key: string]: any;
209
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
210
+ list: ChatListState;
211
+ label: string;
212
+ }> & Readonly<{}>, {
213
+ label: string;
214
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
215
+ /** Vue component that shows what the next request carries against the context budget. */
216
+ export declare const ContextMeter: import("vue").DefineComponent<{
217
+ thread: ChatThread;
218
+ budget: number;
219
+ system: string;
220
+ }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
221
+ [key: string]: any;
222
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
223
+ thread: ChatThread;
224
+ budget: number;
225
+ system: string;
226
+ }> & Readonly<{}>, {
227
+ budget: number;
228
+ system: string;
229
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
230
+ /**
231
+ * Vue component that draws a frame with boxes, landmarks and a caption; emits `view` with the
232
+ * mounted view.
233
+ */
234
+ export declare const FrameView: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
235
+ source: {
236
+ type: PropType<string | HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | null>;
237
+ default: null;
238
+ };
239
+ results: {
240
+ type: PropType<FrameResults>;
241
+ default: () => {};
242
+ };
243
+ mirror: {
244
+ type: BooleanConstructor;
245
+ default: boolean;
246
+ };
247
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
248
+ [key: string]: any;
249
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "view"[], "view", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
250
+ source: {
251
+ type: PropType<string | HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | null>;
252
+ default: null;
253
+ };
254
+ results: {
255
+ type: PropType<FrameResults>;
256
+ default: () => {};
257
+ };
258
+ mirror: {
259
+ type: BooleanConstructor;
260
+ default: boolean;
261
+ };
262
+ }>> & Readonly<{
263
+ onView?: (...args: any[]) => any;
264
+ }>, {
265
+ source: string | HTMLCanvasElement | HTMLImageElement | HTMLVideoElement | null;
266
+ results: FrameResults;
267
+ mirror: boolean;
268
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
269
+ /** Vue component that opens the camera; emits `feed` with the feed and `frame` with the video at `fps`. */
270
+ export declare const CameraFeed: import("vue").DefineComponent<{
271
+ fps: number;
272
+ }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
273
+ [key: string]: any;
274
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("feed" | "frame")[], "feed" | "frame", import("vue").PublicProps, Readonly<{
275
+ fps: number;
276
+ }> & Readonly<{
277
+ onFeed?: (...args: any[]) => any;
278
+ onFrame?: (...args: any[]) => any;
279
+ }>, {
280
+ fps: number;
281
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;