Class: Document
Constructorsβ
constructorβ
β’ new Document(canvg
, Β«destructuredΒ»?
)
Parametersβ
Name | Type |
---|---|
canvg | Canvg |
Β«destructuredΒ» | IDocumentOptions |
Defined inβ
Propertiesβ
createCanvasβ
βͺ Static
Readonly
createCanvas: (width
: number
, height
: number
) => HTMLCanvasElement
= createCanvas
Type declarationβ
βΈ (width
, height
): HTMLCanvasElement
Parametersβ
Name | Type |
---|---|
width | number |
height | number |
Returnsβ
HTMLCanvasElement
Defined inβ
createImageβ
βͺ Static
Readonly
createImage: (src
: string
, anonymousCrossOrigin
: boolean
) => Promise
<HTMLImageElement
> = createImage
Type declarationβ
βΈ (src
, anonymousCrossOrigin?
): Promise
<HTMLImageElement
>
Parametersβ
Name | Type | Default value |
---|---|---|
src | string | undefined |
anonymousCrossOrigin | boolean | false |
Returnsβ
Promise
<HTMLImageElement
>
Defined inβ
elementTypesβ
βͺ Static
Readonly
elementTypes: Record
<string
, AnyElement
> = elementTypes
Defined inβ
rootEmSizeβ
β’ rootEmSize: number
Defined inβ
documentElementβ
β’ Optional
documentElement: SVGElement
Defined inβ
screenβ
β’ Readonly
screen: Screen
Defined inβ
createCanvasβ
β’ Readonly
createCanvas: CreateCanvas
Defined inβ
createImageβ
β’ Readonly
createImage: CreateImage
Defined inβ
definitionsβ
β’ Readonly
definitions: Record
<string
, Element
> = {}
Defined inβ
stylesβ
β’ Readonly
styles: Record
<string
, Record
<string
, Property
<unknown
>>> = {}
Defined inβ
stylesSpecificityβ
β’ Readonly
stylesSpecificity: Record
<string
, string
> = {}
Defined inβ
imagesβ
β’ Readonly
images: ImageElement
[] = []
Defined inβ
fontsβ
β’ Readonly
fonts: SVGFontLoader
[] = []
Defined inβ
emSizeStackβ
β’ Private
Readonly
emSizeStack: number
[] = []
Defined inβ
uniqueIdβ
β’ Private
uniqueId: number
= 0
Defined inβ
canvgβ
β’ Readonly
canvg: Canvg
Defined inβ
Accessorsβ
windowβ
β’ get
window(): Window
Returnsβ
Window
Defined inβ
fetchβ
β’ get
fetch(): (input
: RequestInfo
| URL
, init?
: RequestInit
) => Promise
<Response
>
Returnsβ
fn
βΈ (input
, init?
): Promise
<Response
>
Parametersβ
Name | Type |
---|---|
input | RequestInfo | URL |
init? | RequestInit |
Returnsβ
Promise
<Response
>
Defined inβ
ctxβ
β’ get
ctx(): RenderingContext2D
Returnsβ
Defined inβ
emSizeβ
β’ get
emSize(): number
Returnsβ
number
Defined inβ
β’ set
emSize(value
): void
Parametersβ
Name | Type |
---|---|
value | number |
Returnsβ
void
Defined inβ
Methodsβ
bindCreateImageβ
βΈ Private
bindCreateImage(createImage
, anonymousCrossOrigin?
): CreateImage
Parametersβ
Name | Type |
---|---|
createImage | CreateImage |
anonymousCrossOrigin? | boolean |
Returnsβ
Defined inβ
popEmSizeβ
βΈ popEmSize(): void
Returnsβ
void
Defined inβ
getUniqueIdβ
βΈ getUniqueId(): string
Returnsβ
string
Defined inβ
isImagesLoadedβ
βΈ isImagesLoaded(): boolean
Returnsβ
boolean
Defined inβ
isFontsLoadedβ
βΈ isFontsLoaded(): boolean
Returnsβ
boolean
Defined inβ
createDocumentElementβ
βΈ createDocumentElement(document
): SVGElement
Parametersβ
Name | Type |
---|---|
document | Document |
Returnsβ
Defined inβ
createElementβ
βΈ createElement<T
>(node
): T
Type parametersβ
Name | Type |
---|---|
T | extends Element <T > |
Parametersβ
Name | Type |
---|---|
node | HTMLElement |
Returnsβ
T
Defined inβ
createTextNodeβ
βΈ createTextNode(node
): TextNode
Parametersβ
Name | Type |
---|---|
node | HTMLElement |
Returnsβ
TextNode
Defined inβ
setViewBoxβ
βΈ setViewBox(config
): void
Parametersβ
Name | Type |
---|---|
config | IViewBoxConfig |
Returnsβ
void