diff --git a/types/opentok/index.d.ts b/types/opentok/index.d.ts index 4667324d2e..85b9794316 100644 --- a/types/opentok/index.d.ts +++ b/types/opentok/index.d.ts @@ -33,6 +33,18 @@ declare module 'opentok' { hasAudio?: boolean; hasVideo?: boolean; outputMode?: OutputMode; + layout?: ArchiveLayoutOptions; + } + + export type ArchiveLayoutOptions = PredefinedArchiveLayoutOptions | CustomArchiveLayoutOptions; + + export interface PredefinedArchiveLayoutOptions { + type: 'bestFit' | 'pip' | 'verticalPresentation' | 'horizontalPresentation'; + } + + export interface CustomArchiveLayoutOptions { + type: 'custom'; + stylesheet: string; } export type MediaMode = 'relayed' | 'routed'; diff --git a/types/opentok/opentok-tests.ts b/types/opentok/opentok-tests.ts index e1df18c6ea..c0f93f333f 100644 --- a/types/opentok/opentok-tests.ts +++ b/types/opentok/opentok-tests.ts @@ -28,6 +28,21 @@ const archiveOptions: OpenTok.ArchiveOptions = { outputMode: 'individual', }; +const archiveCustomLayoutOptions: OpenTok.ArchiveOptions = { + outputMode: 'composed', + layout: { + type: 'custom', + stylesheet: 'derp', + } +}; + +const archivePredefinedLayoutOptions: OpenTok.ArchiveOptions = { + outputMode: 'composed', + layout: { + type: 'pip', + } +}; + client.startArchive('SESSION_ID', archiveOptions, (err: Error, archive: OpenTok.Archive) => { if (err) return console.log(err); console.log(archive.id);