Interface: PencilSurfaceOptions
Defined in: stroke-types.ts:100
Properties
background?
optionalbackground?: () =>string|undefined
Defined in: stroke-types.ts:133
Opaque paper behind the ink, painted destination-over after the replay — so erased areas read as PAPER, not as holes. Unset (the default) keeps the canvas transparent, which the overlay use case requires: its ink floats over a live page. Set it when the surface IS the page (the scratchpad), and especially when it is captured: captureStream drops alpha, so a transparent canvas streams as ink-on-black.
Returns
string | undefined
className?
optionalclassName?:string
Defined in: stroke-types.ts:152
fadeCurve?
optionalfadeCurve?: () =>"warp"|"crossfade"
Defined in: stroke-types.ts:116
Which exit a fading stroke takes. "warp" (default) is the gesture curve — hold, charge, pop: a stroke ANNOUNCING its death. "crossfade" is the remote preview's handoff (D3): a gentle dissolve that hides the moment the video's copy takes over — width never stretches, so the preview never warps away from the truth beneath it, and the baked tile is reused throughout.
Returns
"warp" | "crossfade"
fadeSec?
optionalfadeSec?: () =>number
Defined in: stroke-types.ts:108
Vanishing-ink lifetime, seconds. 0 (default) persists until cleared.
Returns
number
localInput?
optionallocalInput?:boolean
Defined in: stroke-types.ts:118
Capture local pointer input. Default true.
minCommitPoints?
optionalminCommitPoints?:number
Defined in: stroke-types.ts:122
Minimum committed points. Default 1 (a tap is a dot). The overlay passes 2.
onAutoClear?
optionalonAutoClear?: () =>void
Defined in: stroke-types.ts:151
Every stroke faded away on its own; nothing is left.
Returns
void
onRemoteStrokeEnd?
optionalonRemoteStrokeEnd?: (stroke) =>void
Defined in: stroke-types.ts:149
A REMOTE stroke completed — the iPad's pen, fed through remote*.
Parameters
stroke
Returns
void
onStrokeEnd?
optionalonStrokeEnd?: (stroke) =>void
Defined in: stroke-types.ts:147
Parameters
stroke
Returns
void
onStrokeStart?
optionalonStrokeStart?: (id,tool) =>void
Defined in: stroke-types.ts:146
Parameters
id
string
tool
Returns
void
params
params: () =>
PencilParams
Defined in: stroke-types.ts:104
The instrument, read per stroke-start (so a stroke keeps the brush it began with).
Returns
resize?
optionalresize?:"keep"|"rescale"
Defined in: stroke-types.ts:145
What happens to the ink when the canvas changes size (D4).
"keep" (default): strokes stay at their absolute canvas coordinates — the overlay's posture, where a resize means the page reflowed and the app is expected to retire the ink anyway (PencilSurface.clearAnimated). "rescale": the drawing re-bakes proportionally — the scratchpad's posture, where the plane is a component and nothing reflows inside a canvas. Stroke width scales by the geometric mean of the two axes, so the drawing reads as the same drawing, larger or smaller.
retention?
optionalretention?: () =>number
Defined in: stroke-types.ts:124
How many strokes stay individually addressable: the undo depth. Read per commit.
Returns
number
shouldCapture?
optionalshouldCapture?: (e) =>boolean
Defined in: stroke-types.ts:120
Per-pointerdown veto (the overlay passes !e.shiftKey — shift is inspect).
Parameters
e
PointerEvent
Returns
boolean
target?
optionaltarget?:HTMLElement
Defined in: stroke-types.ts:102
Where to append the canvas. Defaults to document.body.
tool?
optionaltool?: () =>Tool
Defined in: stroke-types.ts:106
Draw or erase, read per stroke-start.