@kitschpatrol/tldraw-cli 4.2.1 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
- import { type Editor, exportToBlob } from 'tldraw';
1
+ import { type Editor } from 'tldraw';
2
2
  declare global {
3
3
  interface Window {
4
4
  editor: Editor;
5
5
  getImage: (options: {
6
- background: boolean;
7
- darkMode: boolean;
8
- format: Parameters<typeof exportToBlob>[0]['format'];
9
- padding: number;
10
- scale: number;
6
+ background?: boolean;
7
+ darkMode?: boolean;
8
+ format: 'json' | 'png' | 'svg';
9
+ padding?: number;
10
+ scale?: number;
11
11
  }) => Promise<string>;
12
12
  }
13
13
  }
@@ -1,4 +1,5 @@
1
- import type { TldrawFormat } from './tldraw-to-image';
1
+ import type { TldrawToImageOptions } from './tldraw-to-image';
2
+ type DownloadOptions = Omit<TldrawToImageOptions, 'frames'>;
2
3
  export default class TldrawController {
3
4
  private readonly href;
4
5
  private page?;
@@ -8,10 +9,10 @@ export default class TldrawController {
8
9
  private get isLocal();
9
10
  start(): Promise<void>;
10
11
  close(): Promise<void>;
11
- download(output: string, filename: string, format: TldrawFormat, stripStyle: boolean, print: boolean, dark: boolean, transparent: boolean): Promise<string[]>;
12
- downloadFrame(output: string, filename: string, format: TldrawFormat, stripStyle: boolean, frameNameOrId: string, print: boolean, dark: boolean, transparent: boolean): Promise<string[]>;
13
- downloadFrames(output: string, filename: string, format: TldrawFormat, stripStyle: boolean, frameNamesOrIds: string[], print: boolean, dark: boolean, transparent: boolean): Promise<string[]>;
14
- downloadAllFrames(output: string, filename: string, format: TldrawFormat, stripStyle: boolean, print: boolean, dark: boolean, transparent: boolean): Promise<string[]>;
12
+ download(options: DownloadOptions): Promise<string[]>;
13
+ downloadFrame(frameNameOrId: string, options: DownloadOptions): Promise<string[]>;
14
+ downloadFrames(frameNamesOrIds: string[], options: DownloadOptions): Promise<string[]>;
15
+ downloadAllFrames(options: DownloadOptions): Promise<string[]>;
15
16
  loadFile(filePath: string): Promise<void>;
16
17
  getShareUrl(): Promise<string>;
17
18
  private _download;
@@ -20,4 +21,6 @@ export default class TldrawController {
20
21
  private getPageFrameWithNameOrId;
21
22
  private getPageFrames;
22
23
  private stripStyleElement;
24
+ private stripUndefined;
23
25
  }
26
+ export {};
@@ -5,7 +5,9 @@ export type TldrawToImageOptions = {
5
5
  frames?: boolean | string[];
6
6
  name?: string;
7
7
  output?: string;
8
+ padding?: number;
8
9
  print?: boolean;
10
+ scale?: number;
9
11
  stripStyle?: boolean;
10
12
  transparent?: boolean;
11
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitschpatrol/tldraw-cli",
3
- "version": "4.2.1",
3
+ "version": "4.3.0",
4
4
  "type": "module",
5
5
  "description": "A CLI tool for exporting tldraw sketch URLs and local .tldr files to SVG or PNG images.",
6
6
  "repository": {
package/readme.md CHANGED
@@ -344,8 +344,8 @@ On GitHub:
344
344
 
345
345
  On Discord:
346
346
 
347
- - [@jorisjh in #ideas\_old](https://discord.com/channels/859816885297741824/859816885801713730/1156880056501665802)
348
- - [@Nitsuj in #ideas\_old](https://discord.com/channels/859816885297741824/859816885801713730/1020352607920869406)
347
+ - [@jorisjh in #ideas_old](https://discord.com/channels/859816885297741824/859816885801713730/1156880056501665802)
348
+ - [@Nitsuj in #ideas_old](https://discord.com/channels/859816885297741824/859816885801713730/1020352607920869406)
349
349
 
350
350
  ## Implementation notes
351
351