chore: Монорепо с общими пакетами
This commit is contained in:
26
packages/video-player/dist/angular/index.d.ts
vendored
Normal file
26
packages/video-player/dist/angular/index.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import { type VideoPlayerRuntimeEventMap, type VideoPlayerRuntimeInitOptions, type VideoPlayerRuntimeState, type VideoPlayerRuntimeUnsubscribe, type VideoPlayerRuntimeUpdateOptions } from "../core";
|
||||
export interface AngularVideoPlayerInput extends Omit<VideoPlayerRuntimeUpdateOptions, "source"> {
|
||||
source?: VideoPlayerRuntimeInitOptions["source"];
|
||||
}
|
||||
export interface AngularVideoPlayerAttachInput extends Omit<VideoPlayerRuntimeInitOptions, "container"> {
|
||||
}
|
||||
export interface AngularVideoPlayerState {
|
||||
input: AngularVideoPlayerInput;
|
||||
runtime: VideoPlayerRuntimeState;
|
||||
}
|
||||
export declare class AngularVideoPlayerAdapter {
|
||||
private readonly runtime;
|
||||
private input;
|
||||
attach(container: HTMLElement, input: AngularVideoPlayerAttachInput): Promise<{
|
||||
input: AngularVideoPlayerInput;
|
||||
runtime: VideoPlayerRuntimeState;
|
||||
}>;
|
||||
update(nextInput: AngularVideoPlayerInput): Promise<{
|
||||
input: AngularVideoPlayerInput;
|
||||
runtime: VideoPlayerRuntimeState;
|
||||
}>;
|
||||
on<K extends keyof VideoPlayerRuntimeEventMap>(event: K, handler: (payload: VideoPlayerRuntimeEventMap[K]) => void): VideoPlayerRuntimeUnsubscribe;
|
||||
destroy(): void;
|
||||
getState(): AngularVideoPlayerState;
|
||||
}
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
packages/video-player/dist/angular/index.d.ts.map
vendored
Normal file
1
packages/video-player/dist/angular/index.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/angular/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EAClC,KAAK,+BAA+B,EAEpC,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,uBAChB,SAAQ,IAAI,CAAC,+BAA+B,EAAE,QAAQ,CAAC;IACvD,MAAM,CAAC,EAAE,6BAA6B,CAAC,QAAQ,CAAC,CAAC;CACjD;AAED,MAAM,WAAW,6BAChB,SAAQ,IAAI,CAAC,6BAA6B,EAAE,WAAW,CAAC;CAAG;AAE5D,MAAM,WAAW,uBAAuB;IACvC,KAAK,EAAE,uBAAuB,CAAC;IAC/B,OAAO,EAAE,uBAAuB,CAAC;CACjC;AAGD,qBAAa,yBAAyB;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA4B;IACpD,OAAO,CAAC,KAAK,CAA+B;IAEtC,MAAM,CAAC,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,6BAA6B;;;;IAcnE,MAAM,CAAC,SAAS,EAAE,uBAAuB;;;;IAc/C,EAAE,CAAC,CAAC,SAAS,MAAM,0BAA0B,EAC5C,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,CAAC,OAAO,EAAE,0BAA0B,CAAC,CAAC,CAAC,KAAK,IAAI,GACvD,6BAA6B;IAIhC,OAAO;IAIP,QAAQ,IAAI,uBAAuB;CAMnC"}
|
||||
43
packages/video-player/dist/angular/index.js
vendored
Normal file
43
packages/video-player/dist/angular/index.js
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
import { VideoPlayerRuntime, } from "../core";
|
||||
// Angular-friendly wrapper around framework-agnostic runtime.
|
||||
export class AngularVideoPlayerAdapter {
|
||||
constructor() {
|
||||
this.runtime = new VideoPlayerRuntime();
|
||||
this.input = {};
|
||||
}
|
||||
async attach(container, input) {
|
||||
this.input = { ...input };
|
||||
const runtime = await this.runtime.init({
|
||||
container,
|
||||
...input,
|
||||
});
|
||||
return {
|
||||
input: this.input,
|
||||
runtime,
|
||||
};
|
||||
}
|
||||
async update(nextInput) {
|
||||
this.input = {
|
||||
...this.input,
|
||||
...nextInput,
|
||||
};
|
||||
const runtime = await this.runtime.update(nextInput);
|
||||
return {
|
||||
input: this.input,
|
||||
runtime,
|
||||
};
|
||||
}
|
||||
on(event, handler) {
|
||||
return this.runtime.on(event, handler);
|
||||
}
|
||||
destroy() {
|
||||
this.runtime.dispose();
|
||||
}
|
||||
getState() {
|
||||
return {
|
||||
input: this.input,
|
||||
runtime: this.runtime.getState(),
|
||||
};
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
packages/video-player/dist/angular/index.js.map
vendored
Normal file
1
packages/video-player/dist/angular/index.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/angular/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,kBAAkB,GAClB,MAAM,SAAS,CAAC;AAejB,8DAA8D;AAC9D,MAAM,OAAO,yBAAyB;IAAtC;QACkB,YAAO,GAAG,IAAI,kBAAkB,EAAE,CAAC;QAC5C,UAAK,GAA4B,EAAE,CAAC;IA+C7C,CAAC;IA7CA,KAAK,CAAC,MAAM,CAAC,SAAsB,EAAE,KAAoC;QACxE,IAAI,CAAC,KAAK,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;QAE1B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YACvC,SAAS;YACT,GAAG,KAAK;SACR,CAAC,CAAC;QAEH,OAAO;YACN,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO;SAC2B,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,SAAkC;QAC9C,IAAI,CAAC,KAAK,GAAG;YACZ,GAAG,IAAI,CAAC,KAAK;YACb,GAAG,SAAS;SACZ,CAAC;QAEF,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAErD,OAAO;YACN,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO;SAC2B,CAAC;IACrC,CAAC;IAED,EAAE,CACD,KAAQ,EACR,OAAyD;QAEzD,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAED,OAAO;QACN,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,QAAQ;QACP,OAAO;YACN,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;SAChC,CAAC;IACH,CAAC;CACD"}
|
||||
Reference in New Issue
Block a user