Namespace libjass
Properties
- debugMode
- Getter
- Debug mode. When true, libjass logs some debug messages.
- boolean
- Map
- Getter
-
Set to the global implementation of Map if the environment has one, else set to ./utility/map.SimpleMap
Can be set to a value using libjass.configure
Set it to null to force ./utility/map.SimpleMap to be used even if a global Map is present.
- function(new:Map, !Array.<!Array.<*>>=)
- Promise
- Getter
-
Set to the global implementation of Promise if the environment has one, else set to ./utility/promise.SimplePromise
Can be set to a value using libjass.configure
Set it to null to force ./utility/promise.SimplePromise to be used even if a global Promise is present.
- function(new:Promise)
- Set
- Getter
-
Set to the global implementation of Set if the environment has one, else set to ./utility/set.SimpleSet
Can be set to a value using libjass.configure
Set it to null to force ./utility/set.SimpleSet to be used even if a global Set is present.
- function(new:Set, !Array.<T>=)
- verboseMode
- Getter
- Verbose debug mode. When true, libjass logs some more debug messages. This setting is independent of libjass.debugMode
- boolean
- version
- Getter
-
The version of libjass. An array like
["0.12.0", 0, 12, 0]
- !Array.<string|number>
Free functions
- configure
- Configures libjass with the given properties.
-
- newConfig
- !*
-
- "debugMode"
- ?boolean
- When true, libjass logs some debug messages.
- "verboseMode"
- ?boolean
- When true, libjass logs some more debug messages. This setting is independent of libjass.debugMode
- "Set"
- ?function(new:Set, !Array.<T>=)
- Sets the Set implementation used by libjass to the provided one. If null, ./utility/set.SimpleSet is used.
- "Map"
- ?function(new:Map, !Array.<!Array.<*>>=)
- Sets the Map implementation used by libjass to the provided one. If null, ./utility/map.SimpleMap is used.
- "Promise"
- ?function(new:Promise)
- Sets the Promise implementation used by libjass to the provided one. If null, ./utility/promise.SimplePromise is used.
- deserialize
-
- str
- string
- Returns
- *
- serialize
- Serializes the given object.
-
- obj
- *
- Returns
- string
Classes
- class ASS
- This class represents an ASS script. It contains the libjass.ScriptProperties, an array of libjass.Styles, and an array of libjass.Dialogues.
-
- attachments
- Getter
- The attachments of this script.
- !Array.<!libjass.Attachment>
- dialogues
- Getter
- The dialogues in this script.
- !Array.<!libjass.Dialogue>
- dialoguesFormatSpecifier
- Getter
- The format specifier for the styles section.
- Array.<string>
- Setter
- The format specifier for the events section.
-
- value
- Array.<string>
- properties
- Getter
- The properties of this script.
- !libjass.ScriptProperties
- styles
- Getter
- The styles in this script.
- !Map.<string, !libjass.Style>
- stylesFormatSpecifier
- Getter
- The format specifier for the styles section.
- Array.<string>
- Setter
- The format specifier for the events section.
-
- value
- Array.<string>
- addAttachment
- Add an attachment to this ASS script.
-
- attachment
- !libjass.Attachment
- addEvent
- Add an event to this ASS script.
-
- line
- string
- The line from the script that contains the new event.
- addStyle
- Add a style to this ASS script.
-
- line
- string
- The line from the script that contains the new style.
- fromJSON
- Custom deserialization for ASS objects.
-
- obj
- !*
- Returns
- !libjass.ASS
- fromReadableStream
- Creates an ASS object from the given ReadableStream.
-
- stream
- !ReadableStream
- encoding
- string="utf-8"
- type
- (number|string)=0
- The type of the script. One of the libjass.Format constants, or one of the strings "ass" and "srt".
- Returns
- !Promise.<!libjass.ASS>
- A promise that will be resolved with the ASS object when it has been fully parsed
- fromStream
- Creates an ASS object from the given libjass.parser.Stream.
-
- stream
- !libjass.parser.Stream
- The stream to parse the script from
- type
- (number|string)=0
- The type of the script. One of the libjass.Format constants, or one of the strings "ass" and "srt".
- Returns
- !Promise.<!libjass.ASS>
- A promise that will be resolved with the ASS object when it has been fully parsed
- fromString
- Creates an ASS object from the raw text of an ASS script.
-
- raw
- string
- The raw text of the script.
- type
- (number|string)=0
- The type of the script. One of the libjass.Format constants, or one of the strings "ass" and "srt".
- Returns
- !Promise.<!libjass.ASS>
- fromUrl
- Creates an ASS object from the given URL.
-
- url
- string
- The URL of the script.
- type
- (number|string)=0
- The type of the script. One of the libjass.Format constants, or one of the strings "ass" and "srt".
- Returns
- !Promise.<!libjass.ASS>
- A promise that will be resolved with the ASS object when it has been fully parsed
- toJSON
- Custom JSON serialization for ASS objects.
- Returns
- !*
- class Attachment
- This class represents an attachment in a libjass.ASS script.
-
- filename
- string
- The filename of this attachment.
- type
- number
- The type of this attachment.
-
- contents
- Getter
- The contents of this attachment in base64 encoding.
- number
- Setter
- The contents of this attachment in base64 encoding.
-
- value
- number
- filename
- Getter
- The filename of this attachment.
- number
- type
- Getter
- The type of this attachment.
- number
- class DeferredPromise.<T>
- A deferred promise.
-
- promise
- Getter
- !Promise.<T>
- reject
- Getter
- function(*)
- Setter
-
- value
- function(*)
- resolve
- Getter
- function(T|!Thenable.<T>)
- Setter
-
- value
- function(T|!Thenable.<T>)
- class Dialogue
- This class represents a dialogue in a libjass.ASS script.
-
- template
- !Map.<string, string>
- The template object that contains the dialogue's properties. It is a map of the string values read from the ASS file.
-
- "Style"
- string
- The name of the default style of this dialogue
- "Start"
- string
- The start time
- "End"
- string
- The end time
- "Layer"
- string
- The layer number
- "Text"
- string
- The text of this dialogue
- ass
- !libjass.ASS
- The ASS object to which this dialogue belongs
-
- alignment
- Getter
- The alignment number of this dialogue.
- number
- containsTransformTag
- Getter
- Convenience getter for whether this dialogue contains a {\t} tag.
- boolean
- end
- Getter
- The end time of this dialogue.
- number
- id
- Getter
- The unique ID of this dialogue. Auto-generated.
- number
- layer
- Getter
- The layer number of this dialogue.
- number
- parts
- Getter
- The libjass.parts of this dialogue.
- !Array.<!libjass.parts.Part>
- start
- Getter
- The start time of this dialogue.
- number
- style
- Getter
- The default style of this dialogue.
- !libjass.Style
- toString
- Returns
- string
- A simple representation of this dialogue's properties and parts.
- _parsePartsString
- Parses this dialogue's parts from the raw parts string.
- class ScriptProperties
- This class represents the properties of a libjass.ASS script.
-
- resolutionX
- Getter
- The horizontal script resolution.
- number
- Setter
- The horizontal script resolution.
-
- value
- number
- resolutionY
- Getter
- The vertical script resolution.
- number
- Setter
- The vertical script resolution.
-
- value
- number
- scaleBorderAndShadow
- Getter
- Whether to scale outline widths and shadow depths from script resolution to video resolution or not. If true, widths and depths are scaled.
- boolean
- Setter
- Whether to scale outline widths and shadow depths from script resolution to video resolution or not. If true, widths and depths are scaled.
-
- value
- boolean
- wrappingStyle
- Getter
- The wrap style. One of the libjass.WrappingStyle constants.
- number
- Setter
- The wrap style. One of the libjass.WrappingStyle constants.
-
- value
- number
- class Style
- This class represents a single global style declaration in a libjass.ASS script. The styles can be obtained via the libjass.ASS.styles property.
-
- template
- !Map.<string, string>
- The template object that contains the style's properties. It is a map of the string values read from the ASS file.
-
- "Name"
- string
- The name of the style
- "Italic"
- string
- -1 if the style is italicized
- "Bold"
- string
- -1 if the style is bold
- "Underline"
- string
- -1 if the style is underlined
- "StrikeOut"
- string
- -1 if the style is struck-through
- "Fontname"
- string
- The name of the font
- "Fontsize"
- string
- The size of the font
- "ScaleX"
- string
- The horizontal scaling of the font
- "ScaleY"
- string
- The vertical scaling of the font
- "Spacing"
- string
- The letter spacing of the font
- "PrimaryColour"
- string
- The primary color
- "OutlineColour"
- string
- The outline color
- "BackColour"
- string
- The shadow color
- "Outline"
- string
- The outline thickness
- "Shadow"
- string
- The shadow depth
- "Alignment"
- string
- The alignment number
- "MarginL"
- string
- The left margin
- "MarginR"
- string
- The right margin
- "MarginV"
- string
- The vertical margin
-
- alignment
- Getter
- The alignment of dialogues of this style.
- number
- bold
- Getter
- Whether this style is bold or not.
- boolean
- borderStyle
- Getter
- The border style of this style.
- number
- fontName
- Getter
- The name of this style's font.
- string
- fontScaleX
- Getter
- The horizontal scaling of this style's font.
- number
- fontScaleY
- Getter
- The vertical scaling of this style's font.
- number
- fontSize
- Getter
- The size of this style's font.
- number
- italic
- Getter
- Whether this style is italicized or not.
- string
- letterSpacing
- Getter
- The letter spacing scaling of this style's font.
- number
- marginLeft
- Getter
- The left margin of dialogues of this style.
- number
- marginRight
- Getter
- The right margin of dialogues of this style.
- number
- marginVertical
- Getter
- The vertical margin of dialogues of this style.
- number
- name
- Getter
- The name of this style.
- string
- outlineColor
- Getter
- The color of this style's outline.
- !libjass.parts.Color
- outlineThickness
- Getter
- The thickness of this style's outline.
- number
- primaryColor
- Getter
- The color of this style's font.
- !libjass.parts.Color
- rotationZ
- Getter
- The default Z-rotation of this style.
- number
- secondaryColor
- Getter
- The alternate color of this style's font, used in karaoke.
- !libjass.parts.Color
- shadowColor
- Getter
- The color of this style's shadow.
- !libjass.parts.Color
- shadowDepth
- Getter
- The depth of this style's shadow.
- number
- strikeThrough
- Getter
- Whether this style is struck-through or not.
- boolean
- underline
- Getter
- Whether this style is underlined or not.
- boolean
Enums
- enum AttachmentType
- The type of an attachment.
-
- Font = 0
- Graphic = 1
- enum BorderStyle
- The border style defined in the libjass.Style properties.
-
- Outline = 1
- OpaqueBox = 3
- enum Format
- The format of the string passed to libjass.ASS.fromString
-
- ASS = 0
- SRT = 1
- enum WrappingStyle
- The wrapping style defined in the libjass.ScriptProperties
-
- NoLineWrapping = 2
Namespace libjass.parser
Free functions
- parse
- Parses a given string with the specified rule.
-
- input
- string
- The string to be parsed.
- rule
- string
- The rule to parse the string with
- Returns
- *
- The value returned depends on the rule used.
Interfaces
Classes
- class BrowserReadableStream implements Stream
- A libjass.parser.Stream that reads from a ReadableStream object.
-
- stream
- !ReadableStream
- encoding
- string
-
- nextLine
- Returns
- !Promise.<?string>
- A promise that will be resolved with the next line, or null if the stream is exhausted.
- class SrtStreamParser
- A parser that parses an libjass.ASS object from a libjass.parser.Stream of an SRT script.
-
- stream
- !libjass.parser.Stream
- The libjass.parser.Stream to parse
-
- ass
- Getter
- !Promise.<!libjass.ASS>
- _onNextLine
-
- line
- string
- class StreamParser
- A parser that parses an libjass.ASS object from a libjass.parser.Stream.
-
- stream
- !libjass.parser.Stream
- The libjass.parser.Stream to parse
-
- ass
- Getter
- !Promise.<!libjass.ASS>
- currentSection
- Getter
- number
- Setter
-
- value
- number
- minimalASS
- Getter
- parsed at the point this promise becomes resolved.
- !Promise.<!libjass.ASS>
- _onNextLine
-
- line
- string
- class StringStream implements Stream
- A libjass.parser.Stream that reads from a string in memory.
-
- str
- string
- The string
-
- nextLine
- Returns
- !Promise.<?string>
- A promise that will be resolved with the next line, or null if the string has been completely read.
- class XhrStream implements Stream
- A libjass.parser.Stream that reads from an XMLHttpRequest object.
-
- xhr
- !XMLHttpRequest
- The XMLHttpRequest object. Make sure to not call .open() on this object before passing it in here, since event handlers cannot be registered after open() has been called.
-
- nextLine
- Returns
- !Promise.<?string>
- A promise that will be resolved with the next line, or null if the stream is exhausted.
- _onXhrError
-
- event
- !ErrorEvent
Namespace libjass.parts
Interfaces
- interface Part
- The base interface of the ASS tag classes.
Classes
- class Alignment
- An alignment tag {\an} or {\a}
-
- value
- number
- {\an###} -> alignment (number)
-
- value
- Getter
- The value of this alignment tag.
- number
- class Alpha
- An alpha tag {\alpha}
-
- value
- ?number
- {\alpha###} -> alpha (number), {\alpha} -> null
-
- value
- Getter
- The value of this alpha tag.
- ?number
- class Blur
- A blur tag {\be}
-
- value
- ?number
- {\be###} -> strength (number), {\be} -> null
-
- value
- Getter
- The value of this blur tag.
- ?number
- class Bold
- A bold tag {\b}
-
- value
- ?boolean|?number
- {\b1} -> true, {\b0} -> false, {\b###} -> weight of the bold (number), {\b} -> null
-
- value
- Getter
- The value of this bold tag.
- ?boolean|?number
- class Border
- A border tag {\bord}
-
- value
- ?number
- {\bord###} -> width (number), {\bord} -> null
-
- value
- Getter
- The value of this border tag.
- ?number
- class BorderX
- A horizontal border tag {\xbord}
-
- value
- ?number
- {\xbord###} -> width (number), {\xbord} -> null
-
- value
- Getter
- The value of this horizontal border tag.
- ?number
- class BorderY
- A vertical border tag {\ybord}
-
- value
- ?number
- {\ybord###} -> height (number), {\ybord} -> null
-
- value
- Getter
- The value of this vertical border tag.
- ?number
- class Color
-
Represents a CSS color with red, green, blue and alpha components.
Instances of this class are immutable.
-
- red
- number
- green
- number
- blue
- number
- alpha
- number=1
-
- alpha
- Getter
- The alpha component of this color as a number between 0 and 1, where 0 means transparent and 1 means opaque.
- number
- blue
- Getter
- The blue component of this color as a number between 0 and 255.
- number
- green
- Getter
- The green component of this color as a number between 0 and 255.
- number
- red
- Getter
- The red component of this color as a number between 0 and 255.
- number
- interpolate
- Returns a new Color by interpolating the current color to the final color by the given progression.
-
- final
- !libjass.parts.Color
- progression
- number
- Returns
- !libjass.parts.Color
- toString
- Returns
- string
- The CSS representation "rgba(...)" of this color.
- withAlpha
-
- value
- ?number
- The new alpha. If null, the existing alpha is used.
- Returns
- !libjass.parts.Color
- Returns a new Color instance with the same color but the provided alpha.
- class ColorKaraoke
- A color karaoke tag {\k}
-
- duration
- number
- {\k###} -> duration (number)
-
- duration
- Getter
- The duration of this color karaoke tag.
- number
- class Comment
- A comment, i.e., any text enclosed in {} that is not understood as an ASS tag.
-
- value
- string
- The text of this comment
-
- value
- Getter
- The value of this comment.
- string
- class ComplexFade
- A complex fade tag {\fade}
-
- a1
- number
- a2
- number
- a3
- number
- t1
- number
- t2
- number
- t3
- number
- t4
- number
-
- a1
- Getter
- The alpha value of this complex fade tag at time t2.
- number
- a2
- Getter
- The alpha value of this complex fade tag at time t3.
- number
- a3
- Getter
- The alpha value of this complex fade tag at time t4.
- number
- t1
- Getter
- The starting time of this complex fade tag.
- number
- t2
- Getter
- The first intermediate time of this complex fade tag.
- number
- t3
- Getter
- The second intermediate time of this complex fade tag.
- number
- t4
- Getter
- The ending time of this complex fade tag.
- number
- class DrawingBaselineOffset
- A drawing mode baseline offset tag {\pbo}
-
- value
- number
-
- value
- Getter
- The value of this drawing mode baseline offset tag.
- number
- class DrawingInstructions
- A pseudo-part representing text interpreted as drawing instructions
-
- instructions
- !Array.<!libjass.parts.drawing.Instruction>
-
- instructions
- Getter
- The instructions contained in this drawing instructions part.
- !Array.<!libjass.parts.drawing.Instruction>
- class DrawingMode
- A drawing mode tag {\p}
-
- scale
- number
-
- scale
- Getter
- The scale of this drawing mode tag.
- number
- class Fade
- A simple fade tag {\fad}
-
- start
- number
- end
- number
-
- end
- Getter
- The end time of this fade tag.
- number
- start
- Getter
- The start time of this fade tag.
- number
- class FontName
- A font name tag {\fn}
-
- value
- ?string
- {\fn###} -> name (string), {\fn} -> null
-
- value
- Getter
- The value of this font name tag.
- ?string
- class FontScaleX
- A horizontal font scaling tag {\fscx}
-
- value
- ?number
- {\fscx###} -> scale (number), {\fscx} -> null
-
- value
- Getter
- The value of this horizontal font scaling tag.
- ?number
- class FontScaleY
- A vertical font scaling tag {\fscy}
-
- value
- ?number
- {\fscy###} -> scale (number), {\fscy} -> null
-
- value
- Getter
- The value of this vertical font scaling tag.
- ?number
- class FontSize
- A font size tag {\fs}
-
- value
- ?number
- {\fs###} -> size (number), {\fs} -> null
-
- value
- Getter
- The value of this font size tag.
- ?number
- class FontSizeMinus
- A font size decrease tag {\fs-}
-
- value
- number
- {\fs-###} -> relative difference (number, percentage)
-
- value
- Getter
- The value of this font size decrease tag.
- number
- class FontSizePlus
- A font size increase tag {\fs+}
-
- value
- number
- {\fs+###} -> relative difference (number, percentage)
-
- value
- Getter
- The value of this font size increase tag.
- number
- class GaussianBlur
- A Gaussian blur tag {\blur}
-
- value
- ?number
- {\blur###} -> strength (number), {\blur} -> null
-
- value
- Getter
- The value of this Gaussian blur tag.
- ?number
- class Italic
- An italic tag {\i}
-
- value
- ?boolean
- {\i1} -> true, {\i0} -> false, {\i} -> null
-
- value
- Getter
- The value of this italic tag.
- ?boolean
- class LetterSpacing
- A letter-spacing tag {\fsp}
-
- value
- ?number
- {\fsp###} -> spacing (number), {\fsp} -> null
-
- value
- Getter
- The value of this letter-spacing tag.
- ?number
- class Move
- A movement tag {\move}
-
- x1
- number
- y1
- number
- x2
- number
- y2
- number
- t1
- ?number
- t2
- ?number
-
- t1
- Getter
- The start time of this move tag.
- ?number
- t2
- Getter
- The end time value of this move tag.
- ?number
- x1
- Getter
- The starting x value of this move tag.
- number
- x2
- Getter
- The ending x value of this move tag.
- number
- y1
- Getter
- The starting y value of this move tag.
- number
- y2
- Getter
- The ending y value of this move tag.
- number
- class NewLine
- A newline character \N.
- class OutlineAlpha
- An outline alpha tag {\3a}
-
- value
- ?number
- {\3a###} -> alpha (number), {\3a} -> null
-
- value
- Getter
- The value of this outline alpha tag.
- ?number
- class OutlineColor
- An outline color tag {\3c}
-
- value
- libjass.parts.Color
- {\3c###} -> color (Color), {\3c} -> null
-
- value
- Getter
- The value of this outline color tag.
- libjass.parts.Color
- class OutlineKaraoke
- An outline karaoke tag {\ko}
-
- duration
- number
- {\ko###} -> duration (number)
-
- duration
- Getter
- The duration of this outline karaoke tag.
- number
- class Position
- A position tag {\pos}
-
- x
- number
- y
- number
-
- x
- Getter
- The x value of this position tag.
- number
- y
- Getter
- The y value of this position tag.
- number
- class PrimaryAlpha
- A primary alpha tag {\1a}
-
- value
- ?number
- {\1a###} -> alpha (number), {\1a} -> null
-
- value
- Getter
- The value of this primary alpha tag.
- ?number
- class PrimaryColor
- A primary color tag {\c} or {\1c}
-
- value
- libjass.parts.Color
- {\1c###} -> color (Color), {\1c} -> null
-
- value
- Getter
- The value of this primary color tag.
- libjass.parts.Color
- class RectangularClip
- A rectangular clip tag {\clip} or {\iclip}
-
- x1
- number
- y1
- number
- x2
- number
- y2
- number
- inside
- boolean
-
- inside
- Getter
- Whether this rectangular clip tag clips the region it encloses or the region it excludes.
- boolean
- x1
- Getter
- The X coordinate of the starting position of this rectangular clip tag.
- number
- x2
- Getter
- The X coordinate of the ending position of this rectangular clip tag.
- number
- y1
- Getter
- The Y coordinate of the starting position of this rectangular clip tag.
- number
- y2
- Getter
- The Y coordinate of the ending position of this rectangular clip tag.
- number
- class Reset
- A style reset tag {\r}
-
- value
- ?string
- {\r###} -> style name (string), {\r} -> null
-
- value
- Getter
- The value of this style reset tag.
- ?string
- class RotateX
- An X-axis rotation tag {\frx}
-
- value
- ?number
- {\frx###} -> angle (number), {\frx} -> null
-
- value
- Getter
- The value of this X-axis rotation tag.
- ?number
- class RotateY
- A Y-axis rotation tag {\fry}
-
- value
- ?number
- {\fry###} -> angle (number), {\fry} -> null
-
- value
- Getter
- The value of this Y-axis rotation tag.
- ?number
- class RotateZ
- A Z-axis rotation tag {\fr} or {\frz}
-
- value
- ?number
- {\frz###} -> angle (number), {\frz} -> null
-
- value
- Getter
- The value of this Z-axis rotation tag.
- ?number
- class RotationOrigin
- A rotation origin tag {\org}
-
- x
- number
- y
- number
-
- x
- Getter
- The x value of this rotation origin tag.
- number
- y
- Getter
- The y value of this rotation origin tag.
- number
- class SecondaryAlpha
- A secondary alpha tag {\2a}
-
- value
- ?number
- {\2a###} -> alpha (number), {\2a} -> null
-
- value
- Getter
- The value of this secondary alpha tag.
- ?number
- class SecondaryColor
- A secondary color tag {\2c}
-
- value
- libjass.parts.Color
- {\2c###} -> color (Color), {\2c} -> null
-
- value
- Getter
- The value of this secondary color tag.
- libjass.parts.Color
- class Shadow
- A shadow tag {\shad}
-
- value
- ?number
- {\shad###} -> depth (number), {\shad} -> null
-
- value
- Getter
- The value of this shadow tag.
- ?number
- class ShadowAlpha
- A shadow alpha tag {\4a}
-
- value
- ?number
- {\4a###} -> alpha (number), {\4a} -> null
-
- value
- Getter
- The value of this shadow alpha tag.
- ?number
- class ShadowColor
- A shadow color tag {\4c}
-
- value
- libjass.parts.Color
- {\4c###} -> color (Color), {\4c} -> null
-
- value
- Getter
- The value of this shadow color tag.
- libjass.parts.Color
- class ShadowX
- A horizontal shadow tag {\xshad}
-
- value
- ?number
- {\xshad###} -> depth (number), {\xshad} -> null
-
- value
- Getter
- The value of this horizontal shadow tag.
- ?number
- class ShadowY
- A vertical shadow tag {\yshad}
-
- value
- ?number
- {\yshad###} -> depth (number), {\yshad} -> null
-
- value
- Getter
- The value of this vertical shadow tag.
- ?number
- class SkewX
- An X-axis shearing tag {\fax}
-
- value
- ?number
- {\fax###} -> angle (number), {\fax} -> null
-
- value
- Getter
- The value of this X-axis shearing tag.
- ?number
- class SkewY
- A Y-axis shearing tag {\fay}
-
- value
- ?number
- {\fay###} -> angle (number), {\fay} -> null
-
- value
- Getter
- The value of this Y-axis shearing tag.
- ?number
- class StrikeThrough
- A strike-through tag {\s}
-
- value
- ?boolean
- {\s1} -> true, {\s0} -> false, {\s} -> null
-
- value
- Getter
- The value of this strike-through tag.
- ?boolean
- class SweepingColorKaraoke
- A sweeping color karaoke tag {\K} or {\kf}
-
- duration
- number
- {\kf###} -> duration (number)
-
- duration
- Getter
- The duration of this sweeping color karaoke tag.
- number
- class Text
- A block of text, i.e., any text not enclosed in {}. Also includes \h.
-
- value
- string
- The content of this block of text
-
- value
- Getter
- The value of this text part.
- string
- toString
- Returns
- string
- class Transform
- A transform tag {\t}
-
- start
- ?number
- end
- ?number
- accel
- ?number
- tags
- !Array.<!libjass.parts.Tag>
-
- accel
- Getter
- The acceleration of this transform tag.
- ?number
- end
- Getter
- The ending time of this transform tag.
- ?number
- start
- Getter
- The starting time of this transform tag.
- ?number
- class Underline
- An underline tag {\u}
-
- value
- ?boolean
- {\u1} -> true, {\u0} -> false, {\u} -> null
-
- value
- Getter
- The value of this underline tag.
- ?boolean
- class VectorClip
- A vector clip tag {\clip} or {\iclip}
-
- scale
- number
- instructions
- !Array.<!libjass.parts.drawing.Instruction>
- inside
- boolean
-
- inside
- Getter
- Whether this vector clip tag clips the region it encloses or the region it excludes.
- boolean
- instructions
- Getter
- The clip commands of this vector clip tag.
- string
- scale
- Getter
- The scale of this vector clip tag.
- number
- class WrappingStyle
- A wrapping style tag {\q}
-
- value
- number
- {\q###} -> style (number)
-
- value
- Getter
- The value of this wrapping style tag.
- number
Namespace libjass.parts.drawing
Interfaces
- interface Instruction
- The base interface of the drawing instructions.
Classes
- class CubicBezierCurveInstruction implements Instruction
- An instruction to draw a cubic bezier curve to a particular position, with two given control points.
-
- x1
- number
- y1
- number
- x2
- number
- y2
- number
- x3
- number
- y3
- number
-
- x1
- Getter
- The X position of the first control point of this cubic bezier curve instruction.
- number
- x2
- Getter
- The X position of the second control point of this cubic bezier curve instruction.
- number
- x3
- Getter
- The ending X position of this cubic bezier curve instruction.
- number
- y1
- Getter
- The Y position of the first control point of this cubic bezier curve instruction.
- number
- y2
- Getter
- The Y position of the second control point of this cubic bezier curve instruction.
- number
- y3
- Getter
- The ending Y position of this cubic bezier curve instruction.
- number
- class LineInstruction implements Instruction
- An instruction to draw a line to a particular position.
-
- x
- number
- y
- number
-
- x
- Getter
- The X position of this line instruction.
- number
- y
- Getter
- The Y position of this line instruction.
- number
- class MoveInstruction implements Instruction
- An instruction to move to a particular position.
-
- x
- number
- y
- number
-
- x
- Getter
- The X position of this move instruction.
- number
- y
- Getter
- The Y position of this move instruction.
- number
Namespace libjass.renderers
Interfaces
- interface Clock
- The clock interface. A clock is used by a renderer as a source of libjass.renderers.ClockEvents.
-
- currentTime
- Getter
- number
- Setter
-
- value
- number
- enabled
- Getter
- boolean
- Setter
-
- value
- boolean
- paused
- Getter
- boolean
- Setter
-
- value
- boolean
- rate
- Getter
- Gets the rate of the clock - how fast the clock ticks compared to real time.
- number
- Setter
- Gets the rate of the clock - how fast the clock ticks compared to real time.
-
- value
- number
- addEventListener
-
- type
- number
- listener
- !Function
- disable
- Disable the clock.
- Returns
- boolean
- True if the clock is now disabled, false if it was already disabled.
- enable
- Enable the clock.
- Returns
- boolean
- True if the clock is now enabled, false if it was already enabled.
- setEnabled
- Enable or disable the clock.
-
- enabled
- boolean
- If true, the clock is enabled, otherwise it's disabled.
- Returns
- boolean
- True if the clock is now in the given state, false if it was already in that state.
- toggle
- Toggle the clock.
Classes
- class AutoClock implements Clock
-
An implementation of libjass.renderers.Clock that automatically ticks and generates libjass.renderers.ClockEvents according to the state of an external driver.
For example, if you're using libjass to render subtitles on a canvas with your own video controls, these video controls will function as the driver to this AutoClock. It would call libjass.renderers.AutoClock.play, libjass.renderers.AutoClock.pause, etc. when the user pressed the corresponding video controls.
The difference from ManualClock is that AutoClock does not require the driver to call something like libjass.renderers.ManualClock.tick. Instead it keeps its own time with a high-resolution requestAnimationFrame-based timer.
If using libjass with a <video> element, consider using libjass.renderers.VideoClock that uses the video element as a driver.
-
- getCurrentTime
- function():number
- A callback that will be invoked to get the current time of the external driver.
- autoPauseAfter
- number
- If two calls to getCurrentTime are more than autoPauseAfter milliseconds apart but return the same time, then the external driver will be considered to have paused.
-
- currentTime
- Getter
- number
- enabled
- Getter
- boolean
- paused
- Getter
- boolean
- rate
- Getter
- Gets the rate of the clock - how fast the clock ticks compared to real time.
- number
- addEventListener
-
- type
- number
- listener
- !Function
- disable
- Disable the clock.
- Returns
- boolean
- True if the clock is now disabled, false if it was already disabled.
- enable
- Enable the clock.
- Returns
- boolean
- True if the clock is now enabled, false if it was already enabled.
- pause
- Tells the clock to pause.
- play
- Tells the clock to start generating ticks.
- seeking
- Tells the clock that the external driver is seeking.
- setEnabled
- Enable or disable the clock.
-
- enabled
- boolean
- If true, the clock is enabled, otherwise it's disabled.
- Returns
- boolean
- True if the clock is now in the given state, false if it was already in that state.
- setRate
- Sets the rate of the clock - how fast the clock ticks compared to real time.
-
- rate
- number
- The new rate of the clock.
- toggle
- Toggle the clock.
- _onTimerTick
-
- timeStamp
- number
- class DefaultRenderer extends WebRenderer
- A default renderer implementation.
-
- video
- !HTMLVideoElement
- ass
- !libjass.ASS
- settings
- libjass.renderers.RendererSettings
-
- resize
-
Resize the subtitles to the dimensions of the video element.
This method accounts for letterboxing if the video element's size is not the same ratio as the video resolution.
- resizeVideo
- @deprecated
- class EventSource.<T>
- A mixin class that represents an event source.
-
- _eventListeners
- Getter
- A map from event type to an array of all the listeners registered for that event type.
- !Map.<T, !Array.<Function>>
- Setter
- A map from event type to an array of all the listeners registered for that event type.
-
- value
- !Map.<T, !Array.<Function>>
- _dispatchEvent
- Calls all listeners registered for the given event type.
-
- type
- !T
- The type of event to dispatch
- args
- !Array.<*>
- Arguments for the listeners of the event
- addEventListener
- Add a listener for the given event.
-
- type
- !T
- The type of event to attach the listener for
- listener
- !Function
- The listener
- class ManualClock implements Clock, EventSource.<ClockEvent>
- An implementation of libjass.renderers.Clock that allows user script to manually trigger libjass.renderers.ClockEvents.
-
- _dispatchEvent
- Getter
- function(number, Array.<*>)
- Setter
-
- value
- function(number, Array.<*>)
- _eventListeners
- Getter
- !Map.<T, !Array.<Function>>
- Setter
-
- value
- !Map.<T, !Array.<Function>>
- addEventListener
- Getter
- function(number, !Function)
- Setter
-
- value
- function(number, !Function)
- currentTime
- Getter
- number
- enabled
- Getter
- boolean
- paused
- Getter
- boolean
- rate
- Getter
- Gets the rate of the clock - how fast the clock ticks compared to real time.
- number
- disable
- Disable the clock.
- Returns
- boolean
- True if the clock is now disabled, false if it was already disabled.
- enable
- Enable the clock.
- Returns
- boolean
- True if the clock is now enabled, false if it was already enabled.
- pause
- Trigger a libjass.renderers.ClockEvent.Pause
- play
- Trigger a libjass.renderers.ClockEvent.Play
- seek
- Seek to the given time. Unlike libjass.renderers.ManualClock.tick this is used to represent a discontinuous jump, such as the user seeking via the video element's position bar.
-
- time
- number
- setEnabled
- Enable or disable the clock.
-
- enabled
- boolean
- If true, the clock is enabled, otherwise it's disabled.
- Returns
- boolean
- True if the clock is now in the given state, false if it was already in that state.
- setRate
- Sets the rate of the clock - how fast the clock ticks compared to real time.
-
- rate
- number
- The new rate of the clock.
- stop
- Trigger a libjass.renderers.ClockEvent.Stop
- tick
- Trigger a libjass.renderers.ClockEvent.Tick with the given time.
-
- currentTime
- number
- toggle
- Toggle the clock.
- class NullRenderer
- A renderer implementation that doesn't output anything.
-
- ass
- !libjass.ASS
- clock
- !libjass.renderers.Clock
- settings
- libjass.renderers.RendererSettings
-
- ass
- Getter
- !libjass.ASS
- clock
- Getter
- !libjass.renderers.Clock
- enabled
- Getter
- boolean
- id
- Getter
- The unique ID of this renderer. Auto-generated.
- number
- settings
- Getter
- !libjass.renderers.RendererSettings
- disable
- Disable the renderer.
- Returns
- boolean
- True if the renderer is now disabled, false if it was already disabled.
- draw
- Draw a dialogue. This is a no-op for this type.
-
- dialogue
- !libjass.Dialogue
- enable
- Enable the renderer.
- Returns
- boolean
- True if the renderer is now enabled, false if it was already enabled.
- preRender
- Pre-render a dialogue. This is a no-op for this type.
-
- dialogue
- !libjass.Dialogue
- setEnabled
- Enable or disable the renderer.
-
- enabled
- boolean
- If true, the renderer is enabled, otherwise it's disabled.
- Returns
- boolean
- True if the renderer is now in the given state, false if it was already in that state.
- toggle
- Toggle the renderer.
- _onClockPause
- Runs when the clock is paused.
- _onClockPlay
- Runs when the clock is enabled, or starts playing, or is resumed from pause.
- _onClockRateChange
- Runs when the clock changes its rate.
- _onClockStop
- Runs when the clock is disabled.
- _onClockTick
- Runs when the clock's current time changed. This might be a result of either regular playback or seeking.
- class RendererSettings
- Settings for the renderer.
-
- enableSvg
- Getter
-
Outlines and blur are implemented using SVG filters by default. When false, they will be rendered using alternative means.
IE 11 and below do not support SVG filters on HTML elements so this should be set to false there. See http://caniuse.com/svg-html for details.
Defaults to true.
- boolean
- Setter
-
Outlines and blur are implemented using SVG filters by default. When false, they will be rendered using alternative means.
IE 11 and below do not support SVG filters on HTML elements so this should be set to false there. See http://caniuse.com/svg-html for details.
Defaults to true.
-
- value
- boolean
- fallbackFonts
- Getter
-
Comma-separated list of fonts to be used when font specified in ASS Styles not loaded.
The value should be a valid CSS font-family property (i.e. comma-separated and individual names in quotes if necessary). Use empty string to disable fallback.
Defaults to 'Arial, Helvetica, sans-serif, "Segoe UI Symbol"'.
- string
- Setter
-
Comma-separated list of fonts to be used when font specified in ASS Styles not loaded.
The value should be a valid CSS font-family property (i.e. comma-separated and individual names in quotes if necessary). Use empty string to disable fallback.
Defaults to 'Arial, Helvetica, sans-serif, "Segoe UI Symbol"'.
-
- value
- string
- fontMap
- Getter
-
A map of font name to one or more URLs of that font. If provided, the fonts in this map are pre-loaded by the WebRenderer when it's created.
The key of each entry of the map is the font name used in the ASS script. There are three choices for the value:
- A single string that you would use for the src attribute of a @font-face rule. Eg: `'url("/fonts.foo.ttf"), url("/fonts/foo-fallback.ttf"), local("Arial.ttf")'`
- An array of the individual sources that you would use for the src attribute of a @font-face rule. Eg: `['url("/fonts.foo.ttf")', 'url("/fonts/foo-fallback.ttf")', 'local("Arial")']`
- An array of URLs. Eg: `["/fonts.foo.ttf", "/fonts/foo-fallback.ttf"]`
Only the first and second forms allow you to use local fonts. The third form only allows you to use remote fonts.
If you have a <style> or <link> element on the page containing @font-face rules, you can use the libjass.renderers.RendererSettings.makeFontMapFromStyleElement convenience method to create a font map.
Defaults to null.
- Map.<string, (string|!Array.<string>)>
- Setter
-
A map of font name to one or more URLs of that font. If provided, the fonts in this map are pre-loaded by the WebRenderer when it's created.
The key of each entry of the map is the font name used in the ASS script. There are three choices for the value:
- A single string that you would use for the src attribute of a @font-face rule. Eg: `'url("/fonts.foo.ttf"), url("/fonts/foo-fallback.ttf"), local("Arial.ttf")'`
- An array of the individual sources that you would use for the src attribute of a @font-face rule. Eg: `['url("/fonts.foo.ttf")', 'url("/fonts/foo-fallback.ttf")', 'local("Arial")']`
- An array of URLs. Eg: `["/fonts.foo.ttf", "/fonts/foo-fallback.ttf"]`
Only the first and second forms allow you to use local fonts. The third form only allows you to use remote fonts.
If you have a <style> or <link> element on the page containing @font-face rules, you can use the libjass.renderers.RendererSettings.makeFontMapFromStyleElement convenience method to create a font map.
Defaults to null.
-
- value
- Map.<string, (string|!Array.<string>)>
- preciseOutlines
- Getter
-
Subtitle outlines will be rendered in full detail. When false, the value of blur is used to draw less outlines for better performance and (hopefully) similar output.
Defaults to false.
- boolean
- Setter
-
Subtitle outlines will be rendered in full detail. When false, the value of blur is used to draw less outlines for better performance and (hopefully) similar output.
Defaults to false.
-
- value
- boolean
- preRenderTime
- Getter
-
Subtitles will be pre-rendered for this amount of time (seconds).
Defaults to 5.
- number
- Setter
-
Subtitles will be pre-rendered for this amount of time (seconds).
Defaults to 5.
-
- value
- number
- useAttachedFonts
- Getter
-
If true, attached TTF fonts in the ASS script will be used. The font is loaded as a data: URI. Requires ES6 typed arrays (ArrayBuffer, DataView, Uint8Array, etc).
The font is naively parsed to extract the strings that will be used as the font family. Do not use this option with untrusted fonts or scripts.
Defaults to false.
- boolean
- Setter
-
If true, attached TTF fonts in the ASS script will be used. The font is loaded as a data: URI. Requires ES6 typed arrays (ArrayBuffer, DataView, Uint8Array, etc).
The font is naively parsed to extract the strings that will be used as the font family. Do not use this option with untrusted fonts or scripts.
Defaults to false.
-
- value
- boolean
- from
- Converts an arbitrary object into a libjass.renderers.RendererSettings object.
-
- object
- *
- Returns
- !libjass.renderers.RendererSettings
- makeFontMapFromStyleElement
-
A convenience method to create a font map from a <style> or <link> element that contains @font-face rules. There should be one @font-face rule for each font name, mapping to a font file URL.
For example:
More complicated @font-face syntax like format() or multi-line src are not supported.@font-face { font-family: "Helvetica"; src: url("/fonts/helvetica.ttf"), local("Arial"); }
-
- linkStyle
- !LinkStyle
- Returns
- !Map.<string, string>
- class VideoClock implements Clock
- An implementation of libjass.renderers.Clock that generates libjass.renderers.ClockEvents according to the state of a <video> element.
-
- video
- !HTMLVideoElement
-
- currentTime
- Getter
- number
- enabled
- Getter
- boolean
- paused
- Getter
- boolean
- rate
- Getter
- Gets the rate of the clock - how fast the clock ticks compared to real time.
- number
- addEventListener
-
- type
- number
- listener
- !Function
- disable
- Disable the clock.
- Returns
- boolean
- True if the clock is now disabled, false if it was already disabled.
- enable
- Enable the clock.
- Returns
- boolean
- True if the clock is now enabled, false if it was already enabled.
- setEnabled
- Enable or disable the clock.
-
- enabled
- boolean
- If true, the clock is enabled, otherwise it's disabled.
- Returns
- boolean
- True if the clock is now in the given state, false if it was already in that state.
- toggle
- Toggle the clock.
- class WebRenderer extends NullRenderer implements EventSource.<string>
-
A renderer implementation that draws subtitles to the given <div>
After the renderer fires its ready event, libjass.renderers.WebRenderer.resize must be called to initialize its size before starting the clock.
-
- ass
- !libjass.ASS
- clock
- !libjass.renderers.Clock
- libjassSubsWrapper
- !HTMLDivElement
- Subtitles will be rendered to this <div>
- settings
- !libjass.renderers.RendererSettings
-
- _dispatchEvent
- Getter
- function(number, Array.<*>)
- Setter
-
- value
- function(number, Array.<*>)
- _eventListeners
- Getter
- !Map.<T, !Array.<Function>>
- Setter
-
- value
- !Map.<T, !Array.<Function>>
- addEventListener
- Getter
- function(number, !Function)
- Setter
-
- value
- function(number, !Function)
- libjassSubsWrapper
- Getter
- !HTMLDivElement
- draw
- Returns the subtitle div for display. The libjass.renderers.Clock.currentTime of the libjass.renderers.NullRenderer.clock is used to shift the animations appropriately, so that at the time the div is inserted into the DOM and the animations begin, they are in sync with the clock time.
-
- dialogue
- !libjass.Dialogue
- preRender
- The magic happens here. The subtitle div is rendered and stored. Call libjass.renderers.WebRenderer.draw to get a clone of the div to display.
-
- dialogue
- !libjass.Dialogue
- Returns
- PreRenderedSub
- resize
- Resize the subtitles to the given new dimensions.
-
- width
- number
- height
- number
- left
- number=0
- top
- number=0
- _calculateFontMetricsAfterFetch
-
- fontFamily
- string
- fontFetchPromise
- !Promise.<*>
- Returns
- !Promise.<[number, number]>
- _removeSub
-
- sub
- !HTMLDivElement
Enums
- enum ClockEvent
- The type of clock event.
-
- Play = 0
- Tick = 1
- Pause = 2
- Stop = 3
- RateChange = 4
Namespace libjass.webworker
Properties
- supported
- Getter
- Indicates whether web workers are supposed in this environment or not.
- boolean
Free functions
- createWorker
- Create a new web worker and returns a libjass.webworker.WorkerChannel to it.
-
- scriptPath
- string=
- The path to libjass.js to be loaded in the web worker. If the browser supports document.currentScript, the parameter is optional and, if not provided, the path will be determined from the src attribute of the <script> element that contains the currently running copy of libjass.js
- Returns
- !libjass.webworker.WorkerChannel
- A communication channel to the new web worker.
Interfaces
- interface WorkerChannel
- Represents a communication channel between the host and the web worker. An instance of this class is created by calling libjass.webworker.createWorker
-
- request
- Sends a request to the other side to execute the given command with the given parameters.
-
- command
- number
- parameters
- *
- Returns
- !Promise.<*>
- A promise that will get resolved when the other side computes the result
Enums
- enum WorkerCommands
- The commands that can be sent to or from a web worker.
-
- Response = 0
- Parse = 1
- Ping = 2
Module ./parser/misc
Free functions
- parseLineIntoProperty
- Parses a line into a ./types/misc.Property.
-
- line
- string
- Returns
- Property
- parseLineIntoTypedTemplate
- Parses a line into a ./types/misc.TypedTemplate according to the given format specifier.
-
- line
- string
- formatSpecifier
- !Array.<string>
- Returns
- TypedTemplate
Module ./parser/parse
Free functions
- makeTagParserFunction
- Constructs a simple tag parser function and sets it on the prototype of the ./parser/parse.ParserRun class.
-
- tagName
- string
- The name of the tag to generate the parser function for
- tagConstructor
- function(new: !libjass.parts.Part, *)
- The type of tag to be returned by the generated parser function
- valueParser
- function(!ParseNode): ParseNode
- The parser for the tag's value
- required
- boolean
- Whether the tag's value is required or optional
Classes
- class ParseNode
- This class represents a single parse node. It has a start and end position, and an optional value object.
-
- parent
- ParseNode
- The parent of this parse node.
- value
- *=null
- If provided, it is assigned as the value of the node.
-
- children
- Getter
- !Array.<!ParseNode>
- end
- Getter
- The end position of this parse node.
- number
- parent
- Getter
- ParseNode
- start
- Getter
- The start position of this parse node.
- number
- value
- Getter
- An optional object associated with this parse node.
- *
- Setter
-
An optional object associated with this parse node.
If the value is a string, then the end property is updated to be the length of the string.
-
- value
- *
- pop
- Removes the last child of this node and updates the end position to be end position of the new last child.
- _setEnd
- Updates the end property of this node and its parent recursively to the root node.
-
- newEnd
- number
- class ParserRun
- This class represents a single run of the parser.
-
- input
- string
- rule
- string
-
- result
- Getter
- ParseNode
- parse_alpha
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_color
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_colorWithAlpha
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_comment
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_decimal
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_decimalInt32
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_decimalOrHexInt32
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_dialogueParts
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_drawingInstructions
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_enableDisable
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_enclosedTags
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_hardspace
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_hexInt32
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_newline
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_1a
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_1c
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_2a
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_2c
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_3a
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_3c
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_4a
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_4c
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_a
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_alpha
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_an
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_b
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_be
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_blur
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_bord
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_c
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_clip
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_fad
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_fade
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_fax
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_fay
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_fn
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_fr
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_frx
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_fry
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_frz
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_fs
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_fscx
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_fscy
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_fsminus
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_fsp
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_fsplus
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_i
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_iclip
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_k
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_K
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_kf
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_ko
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_move
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_org
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_p
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_pbo
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_pos
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_q
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_r
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_s
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_shad
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_t
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_u
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_xbord
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_xshad
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_ybord
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_tag_yshad
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_text
-
- parent
- !ParseNode
- Returns
- ParseNode
- parse_unsignedDecimal
-
- parent
- !ParseNode
- Returns
- ParseNode
- read
-
- parent
- !ParseNode
- next
- string
- Returns
- ParseNode
- _haveMore
- Returns
- boolean
- _parse_tag_clip_or_iclip
-
- tagName
- string
- One of "clip" and "iclip"
- parent
- !ParseNode
- Returns
- ParseNode
- _peek
-
- count
- number=1
- Returns
- string
Module ./parser/stream-parsers
Free functions
- uuencodedToBase64
- Converts a uuencoded string to a base64 string.
-
- str
- string
- Returns
- string
Enums
Module ./parser/streams
Interfaces
- interface ReadableStream
-
- getReader
- Returns
- !ReadableStreamReader
- interface ReadableStreamReader
-
- read
- Returns
- !Promise.<{ value?: Uint8Array, done: boolean }>
- interface TextDecoder
-
- decode
-
- input
- !ArrayBuffer|!ArrayBufferView
- options
- { stream: boolean }
- Returns
- string
- interface TextDecoderConstructor
-
- prototype
- Getter
- !TextDecoder
- Setter
-
- value
- !TextDecoder
Module ./parser/ttf
Free functions
- getTtfNames
- Gets all the font names from the given font attachment.
-
- attachment
- !libjass.Attachment
- Returns
- !libjass.Set.<string>
- field.<T>
-
- type
- number
- Returns
- function(T, string)
- struct.<T>
-
- clazz
- !function(new(): T)
- Returns
- !function(new(): T)
Classes
- class NameRecord
-
- encodingId
- Getter
- number
- Setter
-
- value
- number
- languageId
- Getter
- number
- Setter
-
- value
- number
- length
- Getter
- number
- Setter
-
- value
- number
- nameId
- Getter
- number
- Setter
-
- value
- number
- offset
- Getter
- number
- Setter
-
- value
- number
- platformId
- Getter
- number
- Setter
-
- value
- number
- read
- Getter
- function(!{ dataView: DataView, position: number }): NameRecord
- Setter
-
- value
- function(!{ dataView: DataView, position: number }): NameRecord
- class NameTableHeader
-
- count
- Getter
- number
- Setter
-
- value
- number
- formatSelector
- Getter
- number
- Setter
-
- value
- number
- read
- Getter
- function(!{ dataView: DataView, position: number }): NameTableHeader
- Setter
-
- value
- function(!{ dataView: DataView, position: number }): NameTableHeader
- stringOffset
- Getter
- number
- Setter
-
- value
- number
- class OffsetTable
-
- entrySelector
- Getter
- number
- Setter
-
- value
- number
- majorVersion
- Getter
- number
- Setter
-
- value
- number
- minorVersion
- Getter
- number
- Setter
-
- value
- number
- numTables
- Getter
- number
- Setter
-
- value
- number
- rangeShift
- Getter
- number
- Setter
-
- value
- number
- read
- Getter
- function(!{ dataView: DataView, position: number }): OffsetTable
- Setter
-
- value
- function(!{ dataView: DataView, position: number }): OffsetTable
- searchRange
- Getter
- number
- Setter
-
- value
- number
- class TableRecord
-
- c1
- Getter
- string
- Setter
-
- value
- string
- c2
- Getter
- string
- Setter
-
- value
- string
- c3
- Getter
- string
- Setter
-
- value
- string
- c4
- Getter
- string
- Setter
-
- value
- string
- checksum
- Getter
- number
- Setter
-
- value
- number
- length
- Getter
- number
- Setter
-
- value
- number
- offset
- Getter
- number
- Setter
-
- value
- number
- read
- Getter
- function(!{ dataView: DataView, position: number }): TableRecord
- Setter
-
- value
- function(!{ dataView: DataView, position: number }): TableRecord
Enums
Module ./renderers/settings
Free functions
- isFontFaceRule
-
- rule
- !CSSRule
- Returns
- boolean
- testSupportsSvg
- Returns true if this environment may support SVG filter effects. May return false positives.
- Returns
- boolean
Module ./renderers/web/animation-collection
Classes
- class AnimationCollection
- This class represents a collection of animations. Each animation contains one or more keyframes. The collection can then be converted to a CSS3 representation.
-
- renderer
- !libjass.renderers.NullRenderer
- The renderer that this collection is associated with
- style
- !HTMLStyleElement
- A <style> element to insert the animation rules into
-
- animationDelays
- Getter
- This array should be used to set the "animation-delay" CSS property of the target element.
- !Array.<number>
- animationStyle
- Getter
- This string should be set as the "animation" CSS property of the target element.
- string
- add
- Add an animation to this collection. The given keyframes together make one animation.
-
- timingFunction
- string
- One of the acceptable values for the "animation-timing-function" CSS property
- keyframes
- !Array.<!libjass.renderers.Keyframe>
Module ./renderers/web/drawing-styles
Classes
- class DrawingStyles
- This class represents an ASS drawing - a set of drawing instructions between {\p} tags.
-
- outputScaleX
- number
- outputScaleY
- number
-
- baselineOffset
- Setter
-
- value
- number
- scale
- Setter
-
- value
- number
- toSVG
- Converts this drawing to an <svg> element.
-
- drawingInstructions
- !libjass.parts.DrawingInstructions
- fillColor
- !libjass.parts.Color
- Returns
- !SVGSVGElement
Module ./renderers/web/font-size
Free functions
- calculateFontMetrics
- Calculates font metrics for the given font family.
-
- fontFamily
- string
- fallbackFonts
- string
- fontSizeElement
- !HTMLDivElement
- Returns
- !Promise.<number>
- fontSizeForLineHeight
-
Uses linear interpolation to calculate the CSS font size that would give the specified line height for the specified font family.
WARNING: If fontMetricsCache doesn't already contain a cached value for this font family, and it is not a font already installed on the user's device, then this function may return wrong values. To avoid this, make sure to preload the font using the libjass.renderers.RendererSettings.fontMap property when constructing the renderer.
-
- fontFamily
- string
- lineHeight
- number
- fallbackFonts
- string
- fontSizeElement
- !HTMLDivElement
- fontMetricsCache
- !Map.<string, [number, number]>
- Returns
- number
- fontMetricsFromLineHeights
-
- lowerLineHeight
- number
- upperLineHeight
- number
- Returns
- [number, number]
- fontSizeFromMetrics
-
- lineHeight
- number
- lowerLineHeight
- number
- factor
- number
- Returns
- number
- lineHeightForFontSize
-
- fontFamily
- string
- fontSize
- number
- fallbackFonts
- string
- fontSizeElement
- !HTMLDivElement
- Returns
- !Promise.<number>
- lineHeightForFontSizeSync
-
- fontFamily
- string
- fontSize
- number
- fallbackFonts
- string
- fontSizeElement
- !HTMLDivElement
- Returns
- number
- prepareFontSizeElement
-
- fontFamily
- string
- fontSize
- number
- fallbackFonts
- string
- fontSizeElement
- !HTMLDivElement
Module ./renderers/web/keyframe
Classes
- class Keyframe
- This class represents a single keyframe. It has a list of CSS properties (names and values) associated with a point in time. Multiple keyframes make up an animation.
-
- time
- number
- properties
- !Map.<string, string>
-
- properties
- Getter
- !Map.<string, string>
- time
- Getter
- number
Module ./renderers/web/renderer
Interfaces
- interface PreRenderedSub
-
- animationDelays
- Getter
- !Map.<string, number>
- Setter
-
- value
- !Map.<string, number>
- sub
- Getter
- !HTMLDivElement
- Setter
-
- value
- !HTMLDivElement
- interface FontFaceSet
-
- add
-
- fontFace
- !FontFace
- Returns
- !FontFaceSet
- forEach
-
- callbackfn
- function(!FontFace, !FontFace, !FontFaceSet)
- A function that is called with each value in the set.
- thisArg
- *
Module ./renderers/web/span-styles
Free functions
- createComponentTransferFilter
-
- color
- !libjass.parts.Color
- Returns
- !SVGFEComponentTransferElement
- valueOrDefault.<T>
-
- newValue
- ?T
- defaultValue
- !T
- Returns
- !T
Classes
- class SpanStyles
- This class represents the style attribute of a span. As a Dialogue's div is rendered, individual parts are added to span's, and this class is used to maintain the style attribute of those.
-
- renderer
- !libjass.renderers.NullRenderer
- The renderer that this set of styles is associated with
- dialogue
- !libjass.Dialogue
- The Dialogue that this set of styles is associated with
- scaleX
- number
- The horizontal scaling of the subtitles
- scaleY
- number
- The vertical scaling of the subtitles
- settings
- !libjass.renderers.RendererSettings
- The renderer settings
- fontSizeElement
- !HTMLDivElement
- A <div> element to measure font sizes with
- svgDefsElement
- !SVGDefsElement
- An SVG <defs> element to append filter definitions to
- fontMetricsCache
- !Map<string, [number, number]>
- Font metrics cache
-
- blur
- Getter
- Gets the blur property.
- number
- Setter
- Sets the blur property. null defaults it to 0.
-
- value
- ?number
- bold
- Setter
- Sets the bold property. null defaults it to the default style's value.
-
- value
- (?boolean|?number)
- fontName
- Setter
- Sets the font name property. null defaults it to the default style's value.
-
- value
- ?string
- fontScaleX
- Getter
- Gets the horizontal font scaling property.
- number
- Setter
- Sets the horizontal font scaling property. null defaults it to the default style's value.
-
- value
- ?number
- fontScaleY
- Getter
- Gets the vertical font scaling property.
- number
- Setter
- Sets the vertical font scaling property. null defaults it to the default style's value.
-
- value
- ?number
- fontSize
- Getter
- Gets the font size property.
- number
- Setter
- Sets the font size property. null defaults it to the default style's value.
-
- value
- ?number
- gaussianBlur
- Getter
- Gets the Gaussian blur property.
- number
- Setter
- Sets the Gaussian blur property. null defaults it to 0.
-
- value
- ?number
- italic
- Setter
- Sets the italic property. null defaults it to the default style's value.
-
- value
- ?boolean
- letterSpacing
- Getter
- Gets the letter spacing property.
- number
- Setter
- Sets the letter spacing property. null defaults it to the default style's value.
-
- value
- ?number
- outlineAlpha
- Getter
- Gets the outline alpha property.
- number
- Setter
- Sets the outline alpha property.
-
- value
- ?number
- outlineColor
- Getter
- Gets the outline color property.
- !libjass.Color
- Setter
- Sets the outline color property. null defaults it to the default style's value.
-
- value
- libjass.Color
- outlineHeight
- Getter
- Gets the outline height property.
- number
- Setter
- Sets the outline height property. null defaults it to the style's original outline height value.
-
- value
- ?number
- outlineWidth
- Getter
- Gets the outline width property.
- number
- Setter
- Sets the outline width property. null defaults it to the style's original outline width value.
-
- value
- ?number
- primaryAlpha
- Getter
- Gets the primary alpha property.
- number
- Setter
- Sets the primary alpha property.
-
- value
- ?number
- primaryColor
- Getter
- Gets the primary color property.
- !libjass.Color
- Setter
- Sets the primary color property. null defaults it to the default style's value.
-
- value
- libjass.Color
- rotationX
- Getter
- Gets the X-axis rotation property.
- number
- Setter
- Sets the X-axis rotation property.
-
- value
- ?number
- rotationY
- Getter
- Gets the Y-axis rotation property.
- number
- Setter
- Sets the Y-axis rotation property.
-
- value
- ?number
- rotationZ
- Getter
- Gets the Z-axis rotation property.
- number
- Setter
- Sets the Z-axis rotation property.
-
- value
- ?number
- secondaryAlpha
- Getter
- Gets the secondary alpha property.
- number
- Setter
- Sets the secondary alpha property.
-
- value
- ?number
- secondaryColor
- Getter
- Gets the secondary color property.
- !libjass.Color
- Setter
- Sets the secondary color property. null defaults it to the default style's value.
-
- value
- libjass.Color
- shadowAlpha
- Getter
- Gets the shadow alpha property.
- number
- Setter
- Sets the shadow alpha property.
-
- value
- ?number
- shadowColor
- Getter
- Gets the shadow color property.
- !libjass.Color
- Setter
- Sets the shadow color property. null defaults it to the default style's value.
-
- value
- libjass.Color
- shadowDepthX
- Getter
- Gets the shadow width property.
- number
- Setter
- Sets the shadow width property. null defaults it to the style's original shadow depth value.
-
- value
- ?number
- shadowDepthY
- Getter
- Gets the shadow height property.
- number
- Setter
- Sets the shadow height property. null defaults it to the style's original shadow depth value.
-
- value
- ?number
- skewX
- Getter
- Gets the X-axis skew property.
- number
- Setter
- Sets the X-axis skew property.
-
- value
- ?number
- skewY
- Getter
- Gets the Y-axis skew property.
- number
- Setter
- Sets the Y-axis skew property.
-
- value
- ?number
- strikeThrough
- Setter
- Sets the strike-through property. null defaults it to the default style's value.
-
- value
- ?boolean
- underline
- Setter
- Sets the underline property. null defaults it to the default style's value.
-
- value
- ?boolean
- makeNewLine
- Returns
- !HTMLBRElement
- reset
- Resets the styles to the defaults provided by the argument.
-
- newStyle
- libjass.Style
- The new defaults to reset the style to. If null, the styles are reset to the default style of the Dialogue.
- setStylesOnSpan
- Sets the style attribute on the given span element.
-
- span
- !HTMLSpanElement
- animationCollection
- !AnimationCollection
- Returns
- !HTMLSpanElement
- The resulting <span> with the CSS styles applied. This may be a wrapper around the input <span> if the styles were applied using SVG filters.
- _svg
-
- span
- !HTMLSpanElement
- outlineWidth
- number
- outlineHeight
- number
- outlineColor
- !libjass.parts.Color
- shadowDepthX
- number
- shadowDepthY
- number
- shadowColor
- !libjass.parts.Color
- _textShadow
-
- span
- !HTMLSpanElement
- outlineWidth
- number
- outlineHeight
- number
- outlineColor
- !libjass.parts.Color
- shadowDepthX
- number
- shadowDepthY
- number
- shadowColor
- !libjass.parts.Color
Module ./serialization
Free functions
- registerClass
- Registers a class as a serializable type.
-
- clazz
- function(new:*)
Module ./settings
Free functions
- setDebugMode
- Sets the debug mode.
-
- value
- boolean
- setVerboseMode
- Sets the verbose debug mode.
-
- value
- boolean
Module ./types/dialogue
Free functions
- toTime
- Converts this string into the number of seconds it represents. This string must be in the form of hh:mm:ss.MMM
-
- str
- string
- Returns
- number
Module ./types/misc
Free functions
- valueOrDefault.<T>
-
- template
- !Map.<string, string>
- key
- string
- converter
- function(string):T
- validator
- ?function(T):boolean
- defaultValue
- T
- Returns
- T
Interfaces
- interface Property
- A property.
-
- name
- Getter
- string
- Setter
-
- value
- string
- value
- Getter
- string
- Setter
-
- value
- string
- interface TypedTemplate
- A template object with a particular type.
-
- template
- Getter
- !Map.<string, string>
- Setter
-
- value
- !Map.<string, string>
- type
- Getter
- string
- Setter
-
- value
- string
Module ./utility/map
Free functions
- setImplementation
- Sets the Map implementation used by libjass to the provided one. If null, ./utility/map.SimpleMap is used.
-
- value
- ?function(new:Map, !Array.<!Array.<*>>=)
Classes
- class SimpleMap.<K, V>
-
Map implementation for browsers that don't support it. Only supports keys which are of Number or String type, or which have a property called "id".
Keys and values are stored as properties of an object, with property names derived from the key type.
-
- iterable
- !Array.<!Array.<*>>=
- Only an array of elements (where each element is a 2-tuple of key and value) is supported.
-
- size
- Getter
- number
- delete
-
- key
- K
- Returns
- boolean
- true if the key was present before being deleted, false otherwise
- forEach
-
- callbackfn
- function(V, K, libjass.Map.<K, V>)
- A function that is called with each key and value in the map.
- thisArg
- *
- get
-
- key
- K
- Returns
- ?V
- has
-
- key
- K
- Returns
- boolean
- set
-
- key
- K
- value
- V
- Returns
- libjass.Map.<K, V>
- This map
- _keyToProperty
- Converts the given key into a property name for the internal map.
-
- key
- K
- Returns
- ?string
Module ./utility/mixin
Free functions
- mixin
- Adds properties of the given mixins' prototypes to the given class's prototype.
-
- clazz
- !*
- mixins
- !Array.<*>
Module ./utility/promise
Free functions
- any.<T>
- Returns a promise that resolves to the first (in time order) promise that fulfills, and rejects if all the promises reject.
-
- promises
- !Array.<!Promise.<T>>
- Returns
- !Promise.<T>
- first.<T>
- Returns a promise that resolves to the first (in iteration order) promise that fulfills, and rejects if all the promises reject.
-
- promises
- !Array.<!Promise.<T>>
- Returns
- !Promise.<T>
- lastly.<T>
- Returns a promise that runs the given callback when the promise has resolved regardless of whether it fulfilled or rejected.
-
- promise
- !Promise.<T>
- body
- function()
- Returns
- !Promise.<T>
- setImplementation
- Sets the Promise implementation used by libjass to the provided one. If null, ./utility/promise.SimplePromise is used.
-
- value
- ?function(new:Promise)
- first_rec.<T>
-
- promises
- !Array.<!Promise.<T>>
- previousRejections
- !Array.<*>
- Returns
- !Promise.<T>
Interfaces
- interface Thenable.<T>
-
- then
- Getter
- function(this:!Thenable.<T>, function(T|!Thenable.<T>), function(*))
- Setter
-
- value
- function(this:!Thenable.<T>, function(T|!Thenable.<T>), function(*))
- interface ThenableThen.<T>
- interface FulfilledPromiseReaction.<T, U>
-
- capabilities
- Getter
- !libjass.DeferredPromise.<U>
- Setter
-
- value
- !libjass.DeferredPromise.<U>
- handler
-
- value
- T
- Returns
- U|!Thenable.<U>
- interface RejectedPromiseReaction.<U>
-
- capabilities
- Getter
- !libjass.DeferredPromise.<U>
- Setter
-
- value
- !libjass.DeferredPromise.<U>
- handler
-
- reason
- *
- Returns
- U|!Thenable.<U>
Classes
- class SimplePromise.<T>
- Promise implementation for browsers that don't support it.
-
- executor
- function(function(T|!Thenable.<T>), function(*))
-
- all.<T>
-
- values
- !Array.<T|!Thenable.<T>>
- Returns
- !Promise.<!Array.<T>>
- catch
-
- onRejected
- function(*):(T|!Thenable.<T>)
- Returns
- !Promise.<T>
- race.<T>
-
- values
- !Array.<T|!Thenable.<T>>
- Returns
- !Promise.<T>
- reject.<T>
-
- reason
- *
- Returns
- !Promise.<T>
- resolve.<T>
-
- value
- T|!Thenable.<T>
- Returns
- !Promise.<T>
- then.<U>
-
- onFulfilled
- ?function(T):(U|!Thenable.<U>)
- onRejected
- ?function(*):(U|!Thenable.<U>)
- Returns
- !Promise.<U>
- _createResolvingFunctions
- Returns
- { resolve(T|!Thenable.<T>), reject(*) }
- _enqueueFulfilledReactionJob
-
- reaction
- !FulfilledPromiseReaction.<T, *>
- value
- T
- _enqueueRejectedReactionJob
-
- reaction
- !RejectedPromiseReaction.<*>
- reason
- *
- _fulfill
-
- value
- T
- _reject
-
- reason
- *
- _resolveWithThenable
-
- thenable
- !Thenable.<T>
- then
- {function(this:!Thenable.<T>, function(T|!Thenable.<T>), function(*))}
Enums
- enum SimplePromiseState
- The state of the ./utility/promise.SimplePromise
-
- PENDING = 0
- FULFILLED = 1
- REJECTED = 2
Module ./utility/set
Free functions
- setImplementation
- Sets the Set implementation used by libjass to the provided one. If null, ./utility/set.SimpleSet is used.
-
- value
- ?function(new:Set, !Array.<T>=)
Classes
- class SimpleSet.<T>
-
Set implementation for browsers that don't support it. Only supports Number and String elements.
Elements are stored as properties of an object, with names derived from their type.
-
- iterable
- !Array.<T>=
- Only an array of values is supported.
-
- size
- Getter
- number
- add
-
- value
- T
- Returns
- libjass.Set.<T>
- This set
- forEach
-
- callbackfn
- function(T, T, libjass.Set.<T>)
- A function that is called with each value in the set.
- thisArg
- *
- has
-
- value
- T
- Returns
- boolean
- _toProperty
- Converts the given value into a property name for the internal map.
-
- value
- T
- Returns
- ?string
Module ./webworker/channel
Interfaces
- interface WorkerCommandHandler
- The signature of a handler registered to handle a particular command in libjass.webworker.WorkerCommands
- interface WorkerCommunication
- The interface implemented by a communication channel to the other side.
-
- addEventListener
-
- type
- string
- listener
- !EventListener
- useCapture
- ?boolean
- postMessage
-
- message
- *
- interface WorkerRequestMessage
- The interface implemented by a request sent to the other side of the communication channel.
-
- command
- Getter
- The command type of this request.
- number
- Setter
- The command type of this request.
-
- value
- number
- parameters
- Getter
- Any parameters serialized with this request.
- *
- Setter
- Any parameters serialized with this request.
-
- value
- *
- requestId
- Getter
- An internal identifier for this request. Used to connect responses to their corresponding requests.
- number
- Setter
- An internal identifier for this request. Used to connect responses to their corresponding requests.
-
- value
- number
- interface WorkerResponseMessage
- The interface implemented by a response received from the other side of the communication channel.
-
- error
- Getter
- Set if the computation of this response resulted in an error.
- *
- Setter
- Set if the computation of this response resulted in an error.
-
- value
- *
- requestId
- Getter
- An internal identifier for this response. Used to connect responses to their corresponding requests.
- number
- Setter
- An internal identifier for this response. Used to connect responses to their corresponding requests.
-
- value
- number
- result
- Getter
- The result of computing this response.
- *
- Setter
- The result of computing this response.
-
- value
- *
Classes
- class WorkerChannelImpl implements WorkerChannel
- Internal implementation of libjass.webworker.WorkerChannel
-
- comm
- !*
- The object used to talk to the other side of the channel. When created by the main thread, this is the Worker object. When created by the web worker, this is its global object.
-
- cancelRequest
-
- requestId
- number
- request
-
- command
- number
- parameters
- *
- Returns
- !Promise.<*>
- _onMessage
-
- rawMessage
- string
- _respond
-
- message
- !WorkerResponseMessage
Module ./webworker/misc
Free functions
- getWorkerCommandHandler
- Gets the handler for the given worker command.
-
- command
- number
- Returns
- ?function(*, function(*, *))
- registerWorkerCommand
- Registers a handler for the given worker command.
-
- command
- number
- The command that this handler will handle. One of the libjass.webworker.WorkerCommands constants.
- handler
- function(*, function(*, *))
- The handler. A function of the form (parameters: *, response: function(error: *, result: *): void): void