Skip to content

KeyframeKit / KeyframesFactory

Interface: KeyframesFactory

Properties

Error

ts
readonly Error: {
  KeyframesRuleNameTypeError: typeof KeyframesRuleNameTypeError;
  SourceTypeError: typeof SourceTypeError;
  StyleSheetImportError: typeof StyleSheetImportError;
};

KeyframesRuleNameTypeError

ts
readonly KeyframesRuleNameTypeError: typeof KeyframesRuleNameTypeError;

SourceTypeError

ts
readonly SourceTypeError: typeof SourceTypeError;

StyleSheetImportError

ts
readonly StyleSheetImportError: typeof StyleSheetImportError;

Methods

getAllStyleSheetKeyframesRules()

ts
getAllStyleSheetKeyframesRules(obj: {
  in: KeyframesFactorySource;
}): ParsedKeyframesRules;

Parameters

obj
in

KeyframesFactorySource

Returns

ParsedKeyframesRules


getDocumentStyleSheetsOnLoad()

ts
getDocumentStyleSheetsOnLoad(obj?: {
  document?: Document;
}): Promise<StyleSheetList>;

Parameters

obj?
document?

Document = window.document

Returns

Promise<StyleSheetList>


getStyleSheetKeyframes()

ts
getStyleSheetKeyframes(obj: {
  in: KeyframesFactorySource;
  of: string;
}): ParsedKeyframes | undefined;

Parameters

obj
in

KeyframesFactorySource

of

string

The name of the @keyframes rule to get keyframes from.

Returns

ParsedKeyframes | undefined


importStyleSheet()

ts
importStyleSheet(url: string): Promise<CSSStyleSheet>;

Parameters

url

string

Returns

Promise<CSSStyleSheet>

Remarks

Note: @import rules won't be resolved in imported stylesheets.
See https://github.com/WICG/construct-stylesheets/issues/119#issuecomment-588352418.


parseKeyframesRule()

ts
parseKeyframesRule(obj: {
  rule: CSSKeyframesRule;
}): ParsedKeyframes;

Parameters

obj
rule

CSSKeyframesRule

Returns

ParsedKeyframes