Masher

Masher Plugin.

interface AddClipsEditArgs 
extends AddClipsEditObject, EditArgs {
  clips: Array<ClientClip>
  createTracks: number
  edits: UndoableEdits
  insertIndex?: number
  redoFrame?: number
  trackIndex: number
  type: string
}
interface AddClipsEditObject 
extends AddTrackEditObject {
  clips: Array<ClientClip>
  createTracks: number
  insertIndex?: number
  redoFrame?: number
  trackIndex: number
  type: string
}
interface AddTrackEditArgs 
extends AddTrackEditObject, EditArgs {
  createTracks: number
  edits: UndoableEdits
  type: string
}
interface AddTrackEditObject 
extends WithType {
  createTracks: number
  type: string
}
interface ChangeEdit 
extends UndoableEdit {
  affects: Array<SignalId>
  isChange: boolean
  redo: () => void
  target: Propertied
  type: string
  undo: () => void
  updateEdit: (object: ChangeEditObject) => void
  updateSelection: () => void
  values: ScalarsById
}
interface ChangeEditArgs 
extends ChangeEditObject, EditArgs {
  edits: UndoableEdits
  isChange?: boolean
  target: Propertied
  type: string
}
interface ChangeEditObject 
extends WithType {
  isChange?: boolean
  target: Propertied
  type: string
}
interface ChangePropertiesEdit 
extends ChangeEdit {
  affects: Array<SignalId>
  isChange: boolean
  redo: () => void
  redoValues: ScalarsById
  target: Propertied
  type: string
  undo: () => void
  undoValues: ScalarsById
  updateEdit: (object: ChangeEditObject) => void
  updateSelection: () => void
  values: ScalarsById
}
interface ChangePropertiesEditArgs 
extends ChangePropertiesEditObject, EditArgs {
  edits: UndoableEdits
  isChange?: boolean
  redoValues: ScalarsById
  target: Propertied
  type: string
  undoValues: ScalarsById
}
interface ChangePropertiesEditObject 
extends ChangeEditObject {
  isChange?: boolean
  redoValues: ScalarsById
  target: Propertied
  type: string
  undoValues: ScalarsById
}
interface ChangePropertyEdit 
extends ChangeEdit {
  affects: Array<SignalId>
  isChange: boolean
  property: SignalId
  redo: () => void
  target: Propertied
  type: string
  undo: () => void
  updateEdit: (object: ChangeEditObject) => void
  updateSelection: () => void
  value?: Scalar
  valueNumber?: number
  values: ScalarsById
}
interface ChangePropertyEditArgs 
extends ChangePropertyEditObject, EditArgs {
  edits: UndoableEdits
  isChange?: boolean
  property: SignalId
  redoValue?: Scalar
  target: Propertied
  type: string
  undoValue?: Scalar
}
interface ChangePropertyEditObject 
extends ChangeEditObject {
  isChange?: boolean
  property: SignalId
  redoValue?: Scalar
  target: Propertied
  type: string
  undoValue?: Scalar
}
interface ClientDescriptionArgs  {
  clip: ClientClip
  mashDescription: ClientMashDescription
}
interface ClientMashDescription 
extends MashDescription {
  border: number
  borderColor: string
  elementsPromise: () => Promise<Array<SvgItem>>
  host: Plugins
  mash: MashMedia
  rect: Rect
  selectedClip?: Clip
  signals: SignalsRecord
  time: Time
}
interface CodeDescription  {
  commandFilters: Array<CommandFilter>
  duration: number
  inputsById: CommandInputRecord
}
interface EditArgs 
extends WithType {
  edits: UndoableEdits
  type: string
}
interface MashDescription  {
  host: Plugins
  mash: MashMedia
  time: Time
}
interface MashDescriptionArgs 
extends MashDescriptionOptions {
  clip?: Clip
  frame?: number
  frames?: number
  mash: MashMedia
  mediaType?: MediaType
  time?: Time
}
interface MashDescriptionOptions  {
  clip?: Clip
  frame?: number
  frames?: number
  mediaType?: MediaType
  time?: Time
}
interface MashPreview  {
  clip: ClientClip
  /** Clip content and container SVG. */
  svgItem: (animate: boolean) => SvgItem
  /** Clip outline and bounds SVGs. */
  svgItems: (lineClasses: Strings, handleClasses: Strings, inactive?: boolean) => Array<SvgItem>
}
interface MashPreviewsArgs 
extends MashPreviewsOptions {
  border?: number
  borderColor?: string
  clip?: Clip
  frame?: number
  frames?: number
  immutable?: boolean
  mash: ClientMash
  mediaType?: MediaType
  rect: Rect
  selectedClip?: ClientClip
  time?: Time
}
interface MashPreviewsOptions 
extends MashDescriptionOptions {
  border?: number
  borderColor?: string
  clip?: Clip
  frame?: number
  frames?: number
  immutable?: boolean
  mediaType?: MediaType
  rect: Rect
  selectedClip?: ClientClip
  time?: Time
}
interface Masher  {}
interface MasherArgs  {
  fps?: number
  masherMedia: MasherMedia
  mediaMasher: MediaMasherNode
  type: MediaType
}
type MasherEditFunction = (args: EditArgs, opts?: ClientJobOptions) => Promise<UndoableEdit>
type MasherEditsFunction = (args: MasherMedia, opts?: ClientJobOptions) => Promise<UndoableEdits>
type MasherMasherFunction = (args: MasherArgs, opts?: ClientJobOptions) => Promise<DataOrError<Masher>>
interface MasherMedia  {
  find: (detail: ApiFindRequest) => Promise<DataOrError<Array<Media>>>
  loadMedia: (storabledMedia: unknown) => Promise<DataOrError<ClientMash>>
  loadedMash?: ClientMash
  mash: (args?: ApiMashRequest) => Promise<DataOrError<ClientMash>>
  mediaCreate: (object: Array<(StorableMedia|Media)>) => Promise<DataOrError<Array<Media>>>
  mediaFromId: (id?: string) => Media | undefined
  remove: (args: ApiRemoveRequest) => Promise<DataOrError<Numbers>>
}
interface MasherMediaArgs  {
  plugins: MediaMasher
}
type MasherMediaFunction = (args: MasherMediaArgs, opts?: ClientJobOptions) => Promise<DataOrError<MasherMedia>>
interface MasherPlugin 
extends Plugable {
  edit: MasherEditFunction
  edits: MasherEditsFunction
  install: function
  masher: MasherMasherFunction
  media: MasherMediaFunction
  svgs: MasherSvgsFunction
}
interface MasherPluginOptions  {
  alwaysShowEncode?: boolean
  alwaysShowSave?: boolean
  alwaysShowView?: boolean
}
type MasherSvgsFunction = (args: MashPreviewsArgs, opts?: ClientJobOptions) => Promise<ClientMashDescription>
interface MasherSyncCode  {
  media: Media
  rawResource: Resource
}
interface MasherSyncDecode 
extends MasherSyncCode {
  media: Media
  rawResource: Resource
}
interface MasherSyncTranscode 
extends MasherSyncCode {
  media: Media
  rawResource: Resource
  transcodingSource: TranscodingSource
}
interface MoveClipEditArgs 
extends MoveClipEditObject, EditArgs {
  clip: ClientClip
  createTracks: number
  edits: UndoableEdits
  insertIndex?: number
  redoFrame?: number
  trackIndex: number
  type: string
  undoFrame?: number
  undoInsertIndex?: number
  undoTrackIndex: number
}
interface MoveClipEditObject 
extends AddTrackEditObject {
  clip: ClientClip
  createTracks: number
  insertIndex?: number
  redoFrame?: number
  trackIndex: number
  type: string
  undoFrame?: number
  undoInsertIndex?: number
  undoTrackIndex: number
}
interface RemoveClipEditArgs 
extends RemoveClipEditObject, EditArgs {
  clip: ClientClip
  edits: UndoableEdits
  index: number
  track: ClientTrack
  type: string
}
interface RemoveClipEditObject 
extends WithType {
  clip: ClientClip
  index: number
  track: ClientTrack
  type: string
}
interface ServerDescriptionArgs 
extends MashDescriptionArgs {
  audioRate?: number
  background?: string
  clip?: Clip
  encodePath: AbsolutePath
  frame?: number
  frames?: number
  jobPath: AbsolutePath
  mash: MashMedia
  mediaType?: MediaType
  mute?: boolean
  outputOptions?: OutputOptions
  size?: Size
  time?: Time
  videoRate?: number
}
interface ServerMashDescription 
extends MashDescription {
  audioRate: number
  background: string
  duration: number
  encodeCommandsPromise: () => Promise<DataOrError<EncodeCommands>>
  encodePath: AbsolutePath
  host: Plugins
  intrinsicsPromise: Promise<DataOrError<number>>
  jobPath: AbsolutePath
  mash: MashMedia
  mediaType: MediaType
  needsPrecoding: boolean
  precodeCommandsPromise: () => Promise<DataOrError<PrecodeCommands>>
  precodingsByClipId: Record<string, AbsolutePath>
  size: Size
  time: Time
  videoRate: number
}
interface SplitClipEditArgs 
extends SplitClipEditObject, EditArgs {
  containerRedoValues?: ScalarsById
  containerUndoValues?: ScalarsById
  edits: UndoableEdits
  frame: number
  index: number
  isChange?: boolean
  redoValues: ScalarsById
  splitClip: ClientClip
  target: Propertied
  type: string
  undoValues: ScalarsById
}
interface SplitClipEditObject 
extends ChangePropertiesEditObject {
  containerRedoValues?: ScalarsById
  containerUndoValues?: ScalarsById
  frame: number
  index: number
  isChange?: boolean
  redoValues: ScalarsById
  splitClip: ClientClip
  target: Propertied
  type: string
  undoValues: ScalarsById
}
interface UndoableEdit 
extends WithType {
  affects: Array<SignalId>
  isChange: boolean
  redo: () => void
  type: string
  undo: () => void
  updateSelection: () => void
}
interface UndoableEdits  {
  canRedo: boolean
  canUndo: boolean
  create: (object: WithType) => Promise<void>
  mash: ClientMash
  redo: () => UndoableEdit | undefined
  save: () => void
  signals: SignalsRecord
  undo: () => UndoableEdit | undefined
}
class AddClipsEditClass
extends AddTrackEditClass {
  affects: () => Array<SignalId>
  clips: Array<ClientClip>
  createTracks: number
  done: boolean
  edits: UndoableEdits
  insertIndex: number | undefined
  isChange: boolean
  mash: () => ClientMash
  redo: () => void
  redoFrame: number | undefined
  signals: () => SignalsRecord
  track: () => ClientTrack
  trackIndex: number
  type: string
  undo: () => void
  updateSelection: () => void
}
/** @implements UndoableEdit */
class AddTrackEditClass
extends EditClass {
  affects: Array<SignalId>
  createTracks: number
  done: boolean
  edits: UndoableEdits
  isChange: boolean
  mash: () => ClientMash
  redo: () => void
  signals: () => SignalsRecord
  type: string
  undo: () => void
  updateSelection: () => void
}
/** @implements UndoableEdit */
class ChangeEditClass
extends EditClass {
  affects: Array<SignalId>
  done: boolean
  edits: UndoableEdits
  isChange: boolean
  mash: () => ClientMash
  redo: () => void
  signals: () => SignalsRecord
  target: Propertied
  type: string
  undo: () => void
  updateEdit: (object: ChangeEditObject) => void
  updateSelection: () => void
  values: () => ScalarsById
}
class ChangeFramesEditClass
extends ChangePropertyEditClass {
  affects: () => Array<SignalId>
  done: boolean
  edits: UndoableEdits
  isChange: boolean
  mash: () => ClientMash
  property: SignalId
  redo: () => void
  redoValue: Scalar | undefined
  signals: () => SignalsRecord
  target: Propertied
  type: string
  undo: () => void
  undoValue: Scalar | undefined
  updateEdit: (object: ChangeEditObject) => void
  updateSelection: () => void
  value: () => Scalar | undefined
  valueNumber: () => number | undefined
  values: () => ScalarsById
}
class ChangePropertiesEditClass
extends ChangeEditClass {
  affects: () => Array<SignalId>
  done: boolean
  edits: UndoableEdits
  isChange: boolean
  mash: () => ClientMash
  redo: () => void
  redoValues: ScalarsById
  signals: () => SignalsRecord
  target: Propertied
  type: string
  undo: () => void
  undoValues: ScalarsById
  updateEdit: (object: ChangeEditObject) => void
  updateSelection: () => void
  values: () => ScalarsById
}
class ChangePropertyEditClass
extends ChangeEditClass {
  affects: () => Array<SignalId>
  done: boolean
  edits: UndoableEdits
  isChange: boolean
  mash: () => ClientMash
  property: SignalId
  redo: () => void
  redoValue: Scalar | undefined
  signals: () => SignalsRecord
  target: Propertied
  type: string
  undo: () => void
  undoValue: Scalar | undefined
  updateEdit: (object: ChangeEditObject) => void
  updateSelection: () => void
  value: () => Scalar | undefined
  valueNumber: () => number | undefined
  values: () => ScalarsById
}
/** @implements MasherPlugin */
class ClientMasherPlugin
extends MasherPluginClass {
  edit: MasherEditFunction
  edits: MasherEditsFunction
  install: function
  masher: MasherMasherFunction
  media: MasherMediaFunction
  mediaMasher: MediaMasher
  svgs: MasherSvgsFunction
}
/** @implements UndoableEdit */
class EditClass {
  affects: Array<SignalId>
  done: boolean
  edits: UndoableEdits
  isChange: boolean
  mash: () => ClientMash
  redo: () => void
  signals: () => SignalsRecord
  type: string
  undo: () => void
  updateSelection: () => void
}
/** @implements MashDescription */
class MashDescriptionClass {
  host: Plugins
  mash: MashMedia
  mediaType: () => MediaType
  quantize: () => number
  time: Time
}
/**
 * Preview of a single track at a single
 * frame, thus representing a single clip.
 * @implements MashPreview
 */
class MashPreviewClass {
  args: ClientDescriptionArgs
  clip: ClientClip
  edits: () => UndoableEdits | undefined
  /** Clip content and container SVG. */
  svgItem: (animate: boolean) => SvgItem
  /** Clip outline and bounds SVGs. */
  svgItems: (lineClasses: Strings, handleClasses: Strings, inactive?: boolean) => Array<SvgItem>
}
/**
 * Preview of a mash at a single frame,
 * including all tracks.
 * @implements ClientMashDescription
 */
class MashPreviewsClass {
  border: number
  borderColor: string
  borderedRect: () => Rect
  elementsPromise: () => Promise<Array<SvgItem>>
  host: Plugins
  mash: MashMedia
  rect: Rect
  selectedClip?: Clip
  signals: SignalsRecord
  time: Time
}
/** @implements Masher */
class MasherClass {}
/** @implements MasherMedia */
class MasherMediaClass {
  constructMediaPromise: Promise<MediaPlugin> | undefined
  defined: (id: string) => boolean
  definedMedia: () => Array<Media>
  find: (detail: ApiFindRequest) => Promise<DataOrError<Array<Media>>>
  findPromises: Map<string, Promise<Array<Media>>>
  fromId: (id?: string) => Promise<(Media|undefined)>
  get: (id: string) => Promise<DataOrError<Media>>
  loadMedia: (storabledMedia: unknown) => Promise<DataOrError<ClientMash>>
  loadedMash?: ClientMash
  mash: (args?: ApiMashRequest) => Promise<DataOrError<ClientMash>>
  mediaCreate: (object: Array<(StorableMedia|Media)>) => Promise<DataOrError<Array<Media>>>
  mediaFromId: (id?: string) => Media | undefined
  remove: (args: ApiRemoveRequest) => Promise<DataOrError<Numbers>>
  signals: () => SignalsRecord
  /**
   * Orchestrates the synchronization of
   * media assets with a remote server using
   * a specific API instance
   */
  syncApi: (api: Api, codes: Array<MasherSyncCode>, progress?: JobProgress) => Promise<DataOrError<true>>
  syncDecodes: (api: Api, codes: Array<MasherSyncCode>) => Promise<DataOrError<Array<MasherSyncDecode>>>
  syncTranscodes: (api: Api, codes: Array<MasherSyncCode>) => Promise<DataOrError<Array<MasherSyncTranscode>>>
  syncUploads: (codes: Array<MasherSyncCode>) => Promise<DataOrError<Array<MasherSyncUpload>>>
  undefine: (idsOrAll?: OrArray<string>) => void
}
/** @implements MasherPlugin */
class MasherPluginClass {
  edit: MasherEditFunction
  edits: MasherEditsFunction
  install: function
  masher: MasherMasherFunction
  media: MasherMediaFunction
  mediaMasher: MediaMasher
  svgs: MasherSvgsFunction
}
class MoveClipEditClass
extends AddTrackEditClass {
  addClip: (trackIndex: number, insertIndex?: number, frame?: number) => void
  affects: () => Array<SignalId>
  clip: ClientClip
  createTracks: number
  done: boolean
  edits: UndoableEdits
  insertIndex: number | undefined
  isChange: boolean
  mash: () => ClientMash
  redo: () => void
  redoFrame: number | undefined
  signals: () => SignalsRecord
  trackIndex: number
  type: string
  undo: () => void
  undoFrame: number | undefined
  undoInsertIndex: number | undefined
  undoTrackIndex: number
  updateSelection: () => void
}
/** @implements UndoableEdit */
class RemoveClipEditClass
extends EditClass {
  affects: Array<SignalId>
  clip: ClientClip
  done: boolean
  edits: UndoableEdits
  index: number
  isChange: boolean
  mash: () => ClientMash
  redo: () => void
  signals: () => SignalsRecord
  track: ClientTrack
  trackIndex: () => number
  type: string
  undo: () => void
  updateSelection: () => void
}
/** @implements ServerMashDescription */
class ServerMashDescriptionClass
extends MashDescriptionClass {
  audioRate: number
  background: string
  duration: number
  encodeCommandsPromise: () => Promise<DataOrError<EncodeCommands>>
  encodeMashCommands: () => Promise<EncodeCommands>
  encodePath: AbsolutePath
  host: Plugins
  intrinsicsPromise: Promise<DataOrError<number>>
  jobPath: AbsolutePath
  mash: MashMedia
  mediaType: MediaType
  needsPrecoding: boolean
  opts: ServerJobOptions
  precodeCommandsPromise: () => Promise<DataOrError<PrecodeCommands>>
  precodingsByClipId: Record<string, AbsolutePath>
  quantize: () => number
  size: Size
  time: Time
  videoRate: number
}
class SplitClipEditClass
extends ChangePropertiesEditClass {
  affects: () => Array<SignalId>
  clip: ClientClip
  container: Instance | undefined
  content: Instance
  done: boolean
  edits: UndoableEdits
  frame: number
  frames: number
  index: number
  isChange: boolean
  mash: () => ClientMash
  redo: () => void
  redoValues: ScalarsById
  signals: () => SignalsRecord
  splitClip: ClientClip
  target: Propertied
  track: ClientTrack
  type: string
  undo: () => void
  undoValues: ScalarsById
  updateEdit: (object: ChangeEditObject) => void
  updateSelection: () => void
  values: () => ScalarsById
}
/** @implements UndoableEdits */
class UndoableEditsClass {
  canRedo: boolean
  canUndo: boolean
  create: (object: WithType) => Promise<void>
  mash: ClientMash
  masherMedia: MasherMedia
  redo: () => UndoableEdit | undefined
  save: () => void
  signals: SignalsRecord
  undo: () => UndoableEdit | undefined
}
/** Type guard for ChangeEdit */
function isChangeEdit(
  value: unknown
): boolean
/** Type guard for ChangeEditObject */
function isChangeEditObject(
  value: unknown
): boolean
/** Type guard for ChangePropertyEdit */
function isChangePropertyEdit(
  value: unknown
): boolean
/** Type guard for ChangePropertyEditObject */
function isChangePropertyEditObject(
  value: unknown
): boolean
/** Type guard for UndoableEdit */
function isUndoableEdit(
  value: unknown
): boolean
function masherEditInstance(
  object: WithType
): UndoableEdit
function masherEditsInstance(
  object: MasherMedia
): UndoableEdits
function masherMasherInstance(
): void
function masherMediaInstance(
): void
function masherSvgsInstance(
  args: MashPreviewsArgs, 
  opts: ClientJobOptions
): Promise<ClientMashDescription>