Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
d17c2db
ObjectConstructor docs
mnaoumov Mar 12, 2025
6384746
ArrayConstructor
mnaoumov Mar 12, 2025
1c65020
Spaces
mnaoumov Mar 12, 2025
ef630f2
Array
mnaoumov Mar 13, 2025
18aa99a
Math
mnaoumov Mar 13, 2025
bf6475d
StringConstructor
mnaoumov Mar 13, 2025
4052cf5
Use quotes consistently
mnaoumov Mar 13, 2025
d35691f
String
mnaoumov Mar 13, 2025
6365160
NumberConstructor
mnaoumov Mar 13, 2025
4250c99
Add typeParams
mnaoumov Mar 13, 2025
6822d27
Node
mnaoumov Mar 13, 2025
4e60d2a
Fix spaces
mnaoumov Mar 13, 2025
c931e04
Remove space
mnaoumov Mar 13, 2025
202bf9f
Element
mnaoumov Mar 13, 2025
96257a7
HTMLElement
mnaoumov Mar 13, 2025
b201734
SVGElement
mnaoumov Mar 13, 2025
54f65fa
Fish
mnaoumov Mar 13, 2025
a98d600
Better example
mnaoumov Mar 13, 2025
35a821f
Better examples
mnaoumov Mar 13, 2025
7598f2b
find
mnaoumov Mar 13, 2025
3209be6
Better examples
mnaoumov Mar 13, 2025
3fc5b91
DomElementInfo
mnaoumov Mar 13, 2025
dd9219d
Combine examples
mnaoumov Mar 13, 2025
7bd5a74
Simplify example
mnaoumov Mar 13, 2025
5c77ff0
SvgElementInfo
mnaoumov Mar 13, 2025
62d6ce7
Node
mnaoumov Mar 13, 2025
0b6d56e
Proper overload
mnaoumov Mar 13, 2025
036e34a
Improve constructorWin
mnaoumov Mar 13, 2025
9629f25
Remove empty lines
mnaoumov Mar 13, 2025
9b67379
createFns
mnaoumov Mar 13, 2025
d597189
Events
mnaoumov Mar 13, 2025
8259c1a
ajax
mnaoumov Mar 13, 2025
3ef7ffe
rest of globals
mnaoumov Mar 13, 2025
7886a76
AbstractInputSuggest
mnaoumov Mar 13, 2025
6d12f8b
AbstractTextComponent
mnaoumov Mar 13, 2025
4fe89e2
addIcon
mnaoumov Mar 13, 2025
cabfc4c
App
mnaoumov Mar 13, 2025
0eb0e5c
ArrayBuffer
mnaoumov Mar 13, 2025
5b1ddec
Fix space
mnaoumov Mar 13, 2025
f455beb
BaseComponent
mnaoumov Mar 13, 2025
81912a4
BlockCache
mnaoumov Mar 13, 2025
bb9b1f4
Better description
mnaoumov Mar 13, 2025
835f132
BlockSubpathResult
mnaoumov Mar 13, 2025
0277a89
Add missing returns
mnaoumov Mar 13, 2025
1ac6794
ButtonComponent
mnaoumov Mar 13, 2025
6d9eee4
CachedMetadata
mnaoumov Mar 13, 2025
1b246d0
CacheItem
mnaoumov Mar 13, 2025
ff65c03
CapacitorAdapter
mnaoumov Mar 13, 2025
072d339
CloseableComponent
mnaoumov Mar 13, 2025
9ae13e7
ColorComponent
mnaoumov Mar 13, 2025
c3bf348
Command
mnaoumov Mar 13, 2025
78dd16b
Spaces
mnaoumov Mar 13, 2025
dc8ba0c
Component
mnaoumov Mar 13, 2025
dda0a08
Constructor
mnaoumov Mar 13, 2025
1d695e7
Update example
mnaoumov Mar 13, 2025
4bdca71
Add missing tsdoc
mnaoumov Mar 13, 2025
a284e20
Fix spaces
mnaoumov Mar 13, 2025
3c00c2e
Improve process docs
mnaoumov Mar 13, 2025
76649ed
Better description
mnaoumov Mar 13, 2025
f8ba260
Improve CapacitorAdapter
mnaoumov Mar 13, 2025
7bfe0e6
DataAdapter
mnaoumov Mar 13, 2025
9f26127
Add links
mnaoumov Mar 13, 2025
d39fc24
DataWriteOptions
mnaoumov Mar 13, 2025
44bcb0a
Debouncer
mnaoumov Mar 13, 2025
59ee0ee
Use foo/bar strings
mnaoumov Mar 13, 2025
f1f0384
displayTooltip
mnaoumov Mar 13, 2025
252ae14
DropdownComponent
mnaoumov Mar 13, 2025
f8be08d
EditableFileView
mnaoumov Mar 13, 2025
4b7d632
Add hotkeys warning
mnaoumov Mar 13, 2025
f8a19b4
Improve HTML element comment
mnaoumov Mar 13, 2025
c00d478
Don't do createEl('div') / span in examples
mnaoumov Mar 13, 2025
1815ec2
Missing empty lines
mnaoumov Mar 13, 2025
385fae8
Editor
mnaoumov Mar 13, 2025
5962bec
Editor types
mnaoumov Mar 13, 2025
fe90446
EditorSuggest
mnaoumov Mar 13, 2025
7b30df8
EmbedCache
mnaoumov Mar 14, 2025
4d0c225
Events
mnaoumov Mar 14, 2025
ea5ae7f
ExtraButtonComponent
mnaoumov Mar 14, 2025
2fb05e5
FileManager
mnaoumov Mar 14, 2025
fba9906
FileSystemAdapter
mnaoumov Mar 14, 2025
75d727b
FileView
mnaoumov Mar 14, 2025
0609e01
finishRenderMath
mnaoumov Mar 14, 2025
f587327
Explicitly mention cache
mnaoumov Mar 14, 2025
c74a344
Cache interfaces
mnaoumov Mar 14, 2025
a4acd45
More caches
mnaoumov Mar 14, 2025
bda35b8
Explicit overrides
mnaoumov Mar 14, 2025
26ab9da
Fuzzy
mnaoumov Mar 14, 2025
2391e7c
Use foo-bar
mnaoumov Mar 14, 2025
ff62980
Fix tsdoc comment ending
mnaoumov Mar 14, 2025
b77d245
Example of icons
mnaoumov Mar 14, 2025
851333e
foobar
mnaoumov Mar 14, 2025
6229ff8
functions
mnaoumov Mar 14, 2025
92b16cb
HeadingCache
mnaoumov Mar 14, 2025
d43744f
Link
mnaoumov Mar 14, 2025
b20fef0
foobar
mnaoumov Mar 14, 2025
2fb7cc2
HeadingCache
mnaoumov Mar 14, 2025
85faaac
Hex
mnaoumov Mar 14, 2025
d75bb34
Hotkey
mnaoumov Mar 14, 2025
3c27a52
Hover
mnaoumov Mar 14, 2025
7eda53c
HSL
mnaoumov Mar 14, 2025
ed54a80
htmlToMarkdown
mnaoumov Mar 14, 2025
4634f12
Instruction
mnaoumov Mar 14, 2025
8133c05
ISuggestOwner
mnaoumov Mar 14, 2025
75b365f
Spaces
mnaoumov Mar 14, 2025
b5b6ab6
ItemView
mnaoumov Mar 14, 2025
3ddba68
iterateRefs
mnaoumov Mar 14, 2025
af634c1
Spaces
mnaoumov Mar 14, 2025
a619260
Keymap
mnaoumov Mar 14, 2025
05868c4
Keymap
mnaoumov Mar 14, 2025
307c68f
More
mnaoumov Mar 14, 2025
1be40a7
More
mnaoumov Mar 14, 2025
17dd991
MarkdownEditView
mnaoumov Mar 14, 2025
8e3b519
Markdown views
mnaoumov Mar 14, 2025
fbd725d
Recover removed code
mnaoumov Mar 14, 2025
1b398fd
MarkdownViews
mnaoumov Mar 14, 2025
e12f3ac
Menu
mnaoumov Mar 14, 2025
61a7d9b
MetadataCache
mnaoumov Mar 14, 2025
67b5ba7
Modal
mnaoumov Mar 15, 2025
9dadd10
Fix examples
mnaoumov Mar 15, 2025
dd2487f
Reformat
mnaoumov Mar 15, 2025
f895620
foobar
mnaoumov Mar 15, 2025
f7b376e
More
mnaoumov Mar 15, 2025
328d4c2
More
mnaoumov Mar 15, 2025
64c6d7c
More
mnaoumov Mar 15, 2025
8d7b4b3
Escape constants
mnaoumov Mar 15, 2025
adc7d3b
Functions
mnaoumov Mar 15, 2025
282d5f5
Platform
mnaoumov Mar 15, 2025
cd9d6f8
Plugin
mnaoumov Mar 15, 2025
16b4983
Point
mnaoumov Mar 15, 2025
d0448d1
Popover
mnaoumov Mar 15, 2025
b20f427
Functions
mnaoumov Mar 15, 2025
99d70b1
ProgressBarComponent
mnaoumov Mar 15, 2025
725942f
Reference
mnaoumov Mar 15, 2025
9c12167
More
mnaoumov Mar 15, 2025
45a8bdb
More
mnaoumov Mar 15, 2025
f6dec44
More
mnaoumov Mar 15, 2025
91b3d74
More
mnaoumov Mar 15, 2025
f089261
Remove useless examples
mnaoumov Mar 15, 2025
30c6b43
Restore removed method and improve examples
mnaoumov Mar 15, 2025
3f6786f
Remove useless examples
mnaoumov Mar 15, 2025
a26f344
Fix ArrayBuffer examples
mnaoumov Mar 15, 2025
3cfdaea
Missing @typeParam
mnaoumov Mar 15, 2025
d18b94c
Remove useless examples
mnaoumov Mar 15, 2025
5101873
Improve description
mnaoumov Mar 15, 2025
d7d1db1
Publish
mnaoumov Mar 15, 2025
24ec13a
Canvas
mnaoumov Mar 15, 2025
6ecb1be
Add description for setCta/removeCta/setWarning
mnaoumov Mar 17, 2025
43a7ca9
Add link to fetch()
mnaoumov Apr 19, 2025
8c26609
fix onunload
mnaoumov Apr 20, 2025
90a370d
Add missing ValueComponent<T>
mnaoumov Apr 20, 2025
2ac696d
allowNoFile
mnaoumov Apr 20, 2025
856a5d6
Use US spelling
mnaoumov Apr 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
236 changes: 207 additions & 29 deletions canvas.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,95 +3,273 @@
* A color used to encode color data for nodes and edges
* can be a number (like '1') representing one of the (currently 6) supported colors.
* or can be a custom color using the hex format '#FFFFFFF'.
*
* @public
*/
export type CanvasColor = string;

/** The overall canvas file's JSON */
/**
* The overall canvas file's JSON.
*
* @public
*/
export interface CanvasData {
/**
* The nodes in the canvas.
*
* @public
*/
nodes: AllCanvasNodeData[];
/**
* The edges in the canvas.
*
* @public
*/
edges: CanvasEdgeData[];

/** Support arbitrary keys for forward compatibility */
/**
* Support arbitrary keys for forward compatibility.
*
* @public
*/
[key: string]: any;
}

/** A node */
/**
* A node.
*
* @public
*/
export interface CanvasNodeData {
/** The unique ID for this node */
/**
* The unique ID for this node.
*
* @public
*/
id: string;
// The positional data
/**
* The x position of the node.
*
* @public
*/
x: number;
/**
* The y position of the node.
*
* @public
*/
y: number;
/**
* The width of the node.
*
* @public
*/
width: number;
/**
* The height of the node.
*
* @public
*/
height: number;
/** The color of this node */
/**
* The color of this node.
*
* @public
*/
color?: CanvasColor;

// Support arbitrary keys for forward compatibility
/**
* Support arbitrary keys for forward compatibility.
*
* @public
*/
[key: string]: any;
}

/**
* Type of possible canvas node data.
*
* @public
*/
export type AllCanvasNodeData = CanvasFileData | CanvasTextData | CanvasLinkData | CanvasGroupData;

/** A node that is a file, where the file is located somewhere in the vault. */
/**
* A node that is a file, where the file is located somewhere in the vault.
*
* @public
*/
export interface CanvasFileData extends CanvasNodeData {
/**
* The type of the node.
*
* @public
*/
type: 'file';
/**
* The file path.
*
* @public
*/
file: string;
/** An optional subpath which links to a heading or a block. Always starts with a `#`. */
/**
* An optional subpath which links to a heading or a block. Always starts with a `#`.
*
* @public
*/
subpath?: string;
}

/** A node that is plaintext. */
/**
* A node that is plaintext.
*
* @public
*/
export interface CanvasTextData extends CanvasNodeData {
/**
* The type of the node.
*
* @public
*/
type: 'text';
/**
* The text content of the node.
*
* @public
*/
text: string;
}

/** A node that is an external resource. */
/**
* A node that is an external resource.
*
* @public
*/
export interface CanvasLinkData extends CanvasNodeData {
/**
* The type of the node.
*
* @public
*/
type: 'link';
/**
* The URL of the node.
*
* @public
*/
url: string;
}

/** The background image rendering style */
/**
* The background image rendering style
*
* @public
*/
export type BackgroundStyle = 'cover' | 'ratio' | 'repeat';

/** A node that represents a group. */
/**
* A node that represents a group.
*
* @public
*/
export interface CanvasGroupData extends CanvasNodeData {
/**
* The type of the node.
*
* @public
*/
type: 'group';
/** Optional label to display on top of the group. */
/**
* Optional label to display on top of the group.
*
* @public
*/
label?: string;
/** Optional background image, stores the path to the image file in the vault. */
/**
* Optional background image, stores the path to the image file in the vault.
*
* @public
*/
background?: string;
/** Optional background image rendering style; defaults to 'cover'. */
/**
* Optional background image rendering style; defaults to 'cover'.
*
* @public
*/
backgroundStyle?: BackgroundStyle;
}

/** The side of the node that a connection is connected to */
/**
* The side of the node that a connection is connected to
*
* @public
*/
export type NodeSide = 'top' | 'right' | 'bottom' | 'left';

/** What to display at the end of an edge */
/**
* What to display at the end of an edge
*
* @public
*/
export type EdgeEnd = 'none' | 'arrow';

/** An edge */
/**
* An edge
*
* @public
*/
export interface CanvasEdgeData {
/** The unique ID for this edge */
/**
* The unique ID for this edge
*
* @public
*/
id: string;
/** The node ID and side where this edge starts */
/**
* The node ID and side where this edge starts
*
* @public
*/
fromNode: string;
/**
* The side where this edge starts
*
* @public
*/
fromSide?: NodeSide;
/** The starting edge end; defaults to 'none' */
/**
* The starting edge end; defaults to 'none'
*
* @public
*/
fromEnd?: EdgeEnd;
/** The node ID and side where this edge ends */
/**
* The node ID and side where this edge ends
*
* @public
*/
toNode: string;
/**
* The side where this edge ends
*
* @public
*/
toSide?: NodeSide;
/** The ending edge end; defaults to 'arrow' */
/**
* The ending edge end; defaults to 'arrow'
*
* @public
*/
toEnd?: EdgeEnd;
/** The color of this edge */
color?: CanvasColor;
/** The text label of this edge, if available */
/**
* The text label of this edge, if available
*
* @public
*/
label?: string;

// Support arbitrary keys for forward compatibility
/**
* Support arbitrary keys for forward compatibility
*
* @public
*/
[key: string]: any;
}
Loading