tldraw/packages/assets/types.d.ts
Mitja Bezenšek bacb307bad
Asset improvements (#1557)
This PR does the following:
- Add `selfHosted.js`, which is a great option for users that wish to
self host the assets. Works well for both self hosting from the public
folder or via a CDN.
- Updates the docs for assets. We now have a dedicated page for assets
where all the options are more clearly explained. I also removed the
assets explanation from the main docs as the unpkg option should work
out of the box and setting up the assets is no longer necessary.
- Cleaned up the `refresh-assets` script. We now use common `types.d.ts`
file to define our types. All the other options then reuse them.
- Pulled out the `formatAssetUrl` into it's own file. It's now static an
no longer generated.
- `urls.d.ts`, `import.d.ts`, and newly added `selfhosted.d.ts` are now
also no longer generated as we can import the types from `types.d.ts`.
- You can now pass a subset of `assetUrls` to `<Tldraw />` and it will
override the default option with the passed in overrides. This makes it
easy to only customizes certain assets (only change the draw font as an
example).

### Change Type

- [x] `patch` — Bug Fix
2023-06-09 11:43:01 +00:00

231 lines
4.9 KiB
TypeScript

// This file is automatically generated by scripts/refresh-assets.ts.
// Do not edit manually.
export type AssetUrl = string | { src: string }
export type AssetUrlOptions = { baseUrl?: string } | ((assetUrl: string) => string)
export type AssetUrls = {
fonts: {
monospace: string
sansSerif: string
serif: string
draw: string
}
icons: {
'align-bottom-center': string
'align-bottom-left': string
'align-bottom-right': string
'align-bottom': string
'align-center-center': string
'align-center-horizontal': string
'align-center-left': string
'align-center-right': string
'align-center-vertical': string
'align-left': string
'align-right': string
'align-top-center': string
'align-top-left': string
'align-top-right': string
'align-top': string
'arrow-left': string
'arrowhead-arrow': string
'arrowhead-bar': string
'arrowhead-diamond': string
'arrowhead-dot': string
'arrowhead-none': string
'arrowhead-square': string
'arrowhead-triangle-inverted': string
'arrowhead-triangle': string
'aspect-ratio': string
avatar: string
blob: string
'bring-forward': string
'bring-to-front': string
check: string
'checkbox-checked': string
'checkbox-empty': string
'chevron-down': string
'chevron-left': string
'chevron-right': string
'chevron-up': string
'chevrons-ne': string
'chevrons-sw': string
'clipboard-copied': string
'clipboard-copy': string
code: string
collab: string
color: string
comment: string
'cross-2': string
cross: string
'dash-dashed': string
'dash-dotted': string
'dash-draw': string
'dash-solid': string
discord: string
'distribute-horizontal': string
'distribute-vertical': string
dot: string
'dots-horizontal': string
'dots-vertical': string
'drag-handle-dots': string
duplicate: string
edit: string
'external-link': string
file: string
'fill-none': string
'fill-pattern': string
'fill-semi': string
'fill-solid': string
follow: string
following: string
'font-draw': string
'font-mono': string
'font-sans': string
'font-serif': string
'geo-arrow-down': string
'geo-arrow-left': string
'geo-arrow-right': string
'geo-arrow-up': string
'geo-check-box': string
'geo-diamond': string
'geo-ellipse': string
'geo-hexagon': string
'geo-octagon': string
'geo-oval': string
'geo-pentagon': string
'geo-rectangle': string
'geo-rhombus-2': string
'geo-rhombus': string
'geo-star': string
'geo-trapezoid': string
'geo-triangle': string
'geo-x-box': string
github: string
group: string
hidden: string
image: string
'info-circle': string
leading: string
link: string
'lock-small': string
lock: string
menu: string
minus: string
mixed: string
pack: string
page: string
plus: string
'question-mark-circle': string
'question-mark': string
redo: string
'reset-zoom': string
'rotate-ccw': string
'rotate-cw': string
ruler: string
search: string
'send-backward': string
'send-to-back': string
'settings-horizontal': string
'settings-vertical-1': string
'settings-vertical': string
'share-1': string
'share-2': string
'size-extra-large': string
'size-large': string
'size-medium': string
'size-small': string
'spline-cubic': string
'spline-line': string
'stack-horizontal': string
'stack-vertical': string
'stretch-horizontal': string
'stretch-vertical': string
'text-align-center': string
'text-align-justify': string
'text-align-left': string
'text-align-right': string
'tool-arrow': string
'tool-embed': string
'tool-eraser': string
'tool-frame': string
'tool-hand': string
'tool-highlight': string
'tool-laser': string
'tool-line': string
'tool-media': string
'tool-note': string
'tool-pencil': string
'tool-pointer': string
'tool-text': string
trash: string
'triangle-down': string
'triangle-up': string
twitter: string
undo: string
ungroup: string
'unlock-small': string
unlock: string
'vertical-align-center': string
'vertical-align-end': string
'vertical-align-start': string
visible: string
'warning-triangle': string
'zoom-in': string
'zoom-out': string
}
translations: {
ar: string
ca: string
da: string
de: string
en: string
es: string
fa: string
fi: string
fr: string
gl: string
he: string
'hi-in': string
hu: string
it: string
ja: string
'ko-kr': string
ku: string
languages: string
main: string
my: string
ne: string
no: string
pl: string
'pt-br': string
'pt-pt': string
ro: string
ru: string
sv: string
te: string
th: string
tr: string
uk: string
vi: string
'zh-cn': string
'zh-tw': string
}
embedIcons: {
codepen: string
codesandbox: string
excalidraw: string
felt: string
figma: string
github_gist: string
google_calendar: string
google_maps: string
google_slides: string
observable: string
replit: string
scratch: string
spotify: string
tldraw: string
vimeo: string
youtube: string
}
}