Skip to content

Interface: IPlatform

Table of contents

Properties

Methods

Properties

name

Optional name: "miniapp" | "web" | "node"

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:11


os

Optional os: "Mac" | "Windows" | "Linux"

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:12


canvas

Optional canvas: ILeaferCanvas

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:16


renderCanvas

Optional renderCanvas: ILeaferCanvas

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:17


canvasType

Optional canvasType: ICanvasType

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:18


isWorker

Optional isWorker: boolean

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:20


isMobile

Optional isMobile: boolean

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:21


devicePixelRatio

Optional Readonly devicePixelRatio: number

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:23


intWheelDeltaY

Optional intWheelDeltaY: boolean

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:25


conicGradientSupport

Optional conicGradientSupport: boolean

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:26


conicGradientRotate90

Optional conicGradientRotate90: boolean

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:27


fullImageShadow

Optional fullImageShadow: boolean

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:28


syncDomFont

Optional syncDomFont: boolean

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:29


selector

Optional selector: ISelector

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:31


origin

Optional origin: Object

Type declaration

NameType
createCanvas(width: number, height: number, format?: "svg" | "pdf") => any
canvasToDataURL(canvas: any, type?: IExportImageType, quality?: number) => string | Promise<string>
canvasToBolb(canvas: any, type?: IExportFileType, quality?: number) => Promise<any>
canvasSaveAs(canvas: any, filename: string, quality?: number) => Promise<void>
download(url: string, filename: string) => Promise<void>
loadImage(url: string) => Promise<any>
noRepeat?string

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:34


roundRectPatch

Optional roundRectPatch: boolean

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:44


ellipseToCurve

Optional ellipseToCurve: boolean

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:45


event

Optional event: Object

Type declaration

NameType
stopDefault(origin: IObject) => void
stopNow(origin: IObject) => void
stop(origin: IObject) => void

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:47


miniapp

Optional miniapp: IMiniapp

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:53


image

image: Object

Type declaration

NameType
hitCanvasSizenumber
maxCacheSizenumber
maxPatternSizenumber
prefix?string
suffix?string
crossOriginstring | false
getRealURLIStringFunction

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:55

Methods

toURL

toURL(text, fileType?): string

Parameters

NameType
textstring
fileType?"svg" | "text"

Returns

string

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:13


requestRender

requestRender(render): void

Parameters

NameType
renderIFunction

Returns

void

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:15


layout

layout(target): void

Parameters

NameType
targetILeaf

Returns

void

Defined in

leafer/packages/interface/src/platform/IPlatform.ts:32

Released under the MIT License.