@t3mode/plugin-sdk 1.2.0 → 1.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +14 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -49,6 +49,15 @@ export interface LocalSocket {
49
49
  onData(callback: (data: Uint8Array) => void): void;
50
50
  onClose(callback: (error?: string) => void): void;
51
51
  }
52
+ /** A local fixed drive. */
53
+ export interface Disk {
54
+ /** The drive's root, such as `C:\`. */
55
+ readonly path: string;
56
+ /** Bytes. */
57
+ readonly total: number;
58
+ /** Bytes available to the user. */
59
+ readonly free: number;
60
+ }
52
61
  export interface PluginApi<O extends OptionsSpec = OptionsSpec> {
53
62
  /** The id from the plugin's manifest.json. */
54
63
  readonly id: string;
@@ -99,6 +108,11 @@ export interface PluginApi<O extends OptionsSpec = OptionsSpec> {
99
108
  /** The first hook state in the tree under the root of `node` that passes `test`. */
100
109
  readonly findHookState: <T>(node: Element, test: (value: unknown) => value is T, budget?: number) => T | undefined;
101
110
  };
111
+ /**
112
+ * Size and free space of each local fixed drive, cached for 30 seconds. Network and removable
113
+ * drives are left out. Added in SDK 1.3.0, so check for it before calling.
114
+ */
115
+ readonly disks?: () => Promise<ReadonlyArray<Disk>>;
102
116
  }
103
117
  export interface PluginDefinition<O extends OptionsSpec = OptionsSpec> {
104
118
  readonly options: O;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t3mode/plugin-sdk",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "definePlugin and the plugin API types for t3mode, the plugin loader for T3 Code",
5
5
  "license": "MIT",
6
6
  "repository": {