@unbound-app/api 0.6.0 → 0.7.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.
package/src/assets.d.ts CHANGED
@@ -47,3 +47,5 @@ export declare function getByName(name: string, type?: 'svg' | 'png'): UnboundAs
47
47
  */
48
48
  export declare function getIDByName(name: string, type?: 'svg' | 'png'): number | undefined;
49
49
  export { _default as default };
50
+
51
+ export {};
package/src/fs.d.ts CHANGED
@@ -50,3 +50,5 @@ export declare function write(
50
50
  export type DCDFileManagerEncoding = 'utf-8' | 'utf8' | 'base64';
51
51
 
52
52
  export { _default as default };
53
+
54
+ export {};
package/src/global.d.ts CHANGED
@@ -1,10 +1,16 @@
1
1
  // Auto-generated by generate-plugin-sdk.ts - DO NOT EDIT
2
2
 
3
3
  export type {
4
+ ADDON_TYPES,
5
+ ActionSheetProps,
6
+ ActionSheetRowProps,
4
7
  Addon,
5
8
  AddonAuthor,
6
9
  AddonManifest,
7
10
  AddonResolveable,
11
+ AddonType,
12
+ AlertActionButtonProps,
13
+ AlertModalProps,
8
14
  AssetsModule,
9
15
  ButtonComponent,
10
16
  ButtonProps,
@@ -12,9 +18,12 @@ export type {
12
18
  ButtonVariant,
13
19
  CardProps,
14
20
  CheckboxProps,
21
+ ContextMenuItem,
22
+ ContextMenuProps,
15
23
  CreateStyles,
16
24
  DesignModule,
17
25
  DiscordAsset,
26
+ DiscordFunction,
18
27
  EnumLike,
19
28
  FloatingActionButtonProps,
20
29
  FontDescriptor,
@@ -27,6 +36,7 @@ export type {
27
36
  InputSize,
28
37
  InputStatus,
29
38
  InternalToastOptions,
39
+ NATIVE_PLUGIN_CAPABILITIES,
30
40
  NativeAssociationKey,
31
41
  NativeCallOptions,
32
42
  NativeClassHandle,
@@ -53,18 +63,28 @@ export type {
53
63
  NativePluginError,
54
64
  NativePluginErrorCode,
55
65
  NativePointer,
66
+ NativeSerializable,
67
+ NativeSerializableObject,
56
68
  NativeStruct,
69
+ NativeStructField,
70
+ NativeStructFields,
57
71
  NativeThreadPolicy,
58
72
  Navigation,
73
+ NavigationOptions,
59
74
  Plugin,
60
75
  PluginContext,
61
76
  PluginEntity,
62
77
  ResolvedStyles,
63
78
  RowButtonProps,
79
+ SegmentedControlItem,
80
+ SegmentedControlPagesProps,
64
81
  SegmentedControlProps,
65
82
  SegmentedControlState,
83
+ SegmentedControlStateOptions,
66
84
  SettingsEntry,
85
+ SettingsObject,
67
86
  SettingsScreen,
87
+ SettingsValue,
68
88
  SliderProps,
69
89
  SplitTextInputProps,
70
90
  StackProps,
@@ -98,18 +118,18 @@ export type {
98
118
  UnboundAsset,
99
119
  } from './_internal';
100
120
  import type { NativePlatformBridge } from './_internal';
121
+ import * as ReactModule from 'react';
122
+ import * as ReactNativeModule from 'react-native';
123
+
101
124
  declare global {
102
125
  /**
103
- * Build-time token, replaced with a boolean literal by the build's `transform.define`. Folds at
104
- * the module-graph level so `if ($$DEV$$)` branches (and any imports inside them) are dead-code
105
- * eliminated from production bundles entirely. Use it (not a runtime check) to gate dev-only code.
126
+ * Build-time token replaced with a boolean literal, so `if ($$DEV$$)` branches (and their
127
+ * imports) are eliminated from production bundles. Use it, not a runtime check, for dev-only code.
106
128
  */
107
129
  var $$DEV$$: boolean;
108
130
  var NativePlatform: NativePlatformBridge | undefined;
109
- var React: typeof import('react');
110
- var ReactNative: typeof import('react-native');
111
-
112
- interface Window {}
131
+ var React: typeof ReactModule;
132
+ var ReactNative: typeof ReactNativeModule;
113
133
  }
114
134
 
115
135
  export interface UnboundGlobal {
package/src/i18n.d.ts CHANGED
@@ -31,7 +31,7 @@ export declare function format(key: string, vars?: FormatVars): string;
31
31
  * @returns A promise that resolves once the initial locales have been ensured and the subscription is wired.
32
32
  */
33
33
  export declare function init(): Promise<void>;
34
- export type FormatVars = Record<string, unknown>;
34
+ export type FormatVars = Record<string, string | number | boolean | Date>;
35
35
  export type LocaleStrings = Record<string, string>;
36
36
  export type Localizations = {
37
37
  Messages: Record<string, string>;
@@ -40,3 +40,5 @@ export type Localizations = {
40
40
  export type StringStore = Record<string, LocaleStrings>;
41
41
 
42
42
  export { _default as default };
43
+
44
+ export {};
package/src/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  // Auto-generated by generate-plugin-sdk.ts - DO NOT EDIT
2
2
 
3
+ export * as assets from './assets';
4
+ export * as fs from './fs';
5
+ export * as i18n from './i18n';
3
6
  export * as metro from './metro/index';
4
- export * as settings from './settings';
7
+ export * as native from './native';
5
8
  export * as patcher from './patcher';
9
+ export * as settings from './settings';
6
10
  export * as storage from './storage';
7
- export * as assets from './assets';
8
- export * as native from './native';
9
11
  export * as toasts from './toasts';
10
- export * as i18n from './i18n';
11
- export * as fs from './fs';
@@ -5,3 +5,5 @@ export declare const Invites: any;
5
5
  export declare const Linking: any;
6
6
  export declare const Messages: any;
7
7
  export declare const Profiles: any;
8
+
9
+ export {};
@@ -21,3 +21,5 @@ export declare const Util: any;
21
21
  export declare const i18n: any;
22
22
 
23
23
  export { Clipboard$1 as Clipboard, React$1 as React, ReactNative$1 as ReactNative };
24
+
25
+ export {};
@@ -1,17 +1,19 @@
1
1
  // Auto-generated by generate-plugin-sdk.ts - DO NOT EDIT
2
2
 
3
3
  export type { DesignModule, SwitchProps } from '../_internal';
4
+ import type { DesignModule, SwitchProps } from '../_internal';
5
+ import * as ReactModule from 'react';
6
+ import { ComponentType, ReactNode } from 'react';
4
7
  import {
8
+ AccessibilityState,
5
9
  ImageStyle,
10
+ PressableProps,
6
11
  StyleProp,
7
12
  TextInputProps as RNTextInputProps,
8
13
  TextStyle,
9
14
  ViewProps,
10
15
  ViewStyle,
11
16
  } from 'react-native';
12
- import { ComponentType, ReactNode } from 'react';
13
-
14
- import type { DesignModule, SwitchProps } from '../_internal';
15
17
  export declare const BackdropFilters: any;
16
18
  export declare const Discord: DesignModule;
17
19
  export declare const FlashList: any;
@@ -20,4 +22,5 @@ export declare const HelpMessage: any;
20
22
  export declare const Media: any;
21
23
  export declare const Portal: any;
22
24
  export declare const SafeArea: any;
23
- export declare const Switch: ComponentType<SwitchProps>;
25
+ export declare const Switch: ReactModule.ComponentType<SwitchProps>;
26
+ export {};
@@ -21,7 +21,7 @@ export declare function byDisplayName(name: string): MetroFilter;
21
21
  * @param path The file path the module must have been imported from.
22
22
  * @returns A {@link MetroFilter} matching the module loaded from that file path.
23
23
  */
24
- export declare function byFilePath(path: string[]): MetroFilter;
24
+ export declare function byFilePath(path: string): MetroFilter;
25
25
  /**
26
26
  * @description Builds a filter matching a module whose `name` equals the given name.
27
27
  * @param name The `name` the module must have.
@@ -53,3 +53,5 @@ export type MetroFilter = ((mdl: any, id: number | string) => PredicateResult) &
53
53
  isRaw?: boolean;
54
54
  };
55
55
  export { _default as default };
56
+
57
+ export {};
@@ -1,16 +1,20 @@
1
1
  // Auto-generated by generate-plugin-sdk.ts - DO NOT EDIT
2
2
 
3
+ export type { DiscordFunction } from '../_internal';
4
+ import type { DiscordFunction } from '../_internal';
5
+ import type { PredicateResult } from '../utils';
6
+ import * as ReactModule from 'react';
7
+ import { ComponentType, ReactNode } from 'react';
3
8
  import {
9
+ AccessibilityState,
4
10
  ImageStyle,
11
+ PressableProps,
5
12
  StyleProp,
6
13
  TextInputProps as RNTextInputProps,
7
14
  TextStyle,
8
15
  ViewProps,
9
16
  ViewStyle,
10
17
  } from 'react-native';
11
- import { ComponentType, ReactNode } from 'react';
12
-
13
- import type { AnyProps, Fn, PredicateResult } from '../utils';
14
18
  /** @internal */
15
19
  declare const CACHE_KEY: unique symbol;
16
20
  export declare const off: typeof removeListener;
@@ -109,22 +113,10 @@ export declare function initializeModule(id: number): boolean;
109
113
  * @param listener The listener to remove.
110
114
  */
111
115
  export declare function removeListener(listener: (mdl: any, id: number) => void): void;
112
-
113
- /** A single entry in a {@link bulk} search: a filter plus its per-item options. */
114
- export interface MetroBulkItem extends Omit<MetroSearchOptions, 'initial' | 'cache'> {
115
- filter: MetroFilter;
116
- }
117
- /** Search options for {@link findLazy}, adding a `signal` that abandons the wait when aborted. */
118
- export interface MetroLazySearchOptions extends Omit<MetroSearchOptions, 'lazy' | 'all'> {
119
- signal?: AbortSignal;
120
- }
121
- /** Search options for {@link findStore}, adding the `short` name-matching toggle. */
122
- export interface MetroStoreOptions extends MetroSearchOptions {
123
- short?: boolean;
124
- }
125
-
116
+ /** An object of shape `T` widened with an arbitrary property index. */
117
+ export type AnyProps<T = unknown> = T & Record<PropertyKey, MetroExport>;
126
118
  /** Widens a single result to an array when the search was made with `all: true`. */
127
- export type MetroAllValues<T extends Record<PropertyKey, any>, U extends unknown> = T extends {
119
+ export type MetroAllValues<T extends MetroSearchOptions, U> = T extends {
128
120
  all: true;
129
121
  }
130
122
  ? U[]
@@ -134,6 +126,10 @@ export type MetroBulkFind<T extends string> = [
134
126
  ...AnyProps<MetroParamsBag<T>>[],
135
127
  AnyProps<MetroBulkMarker>,
136
128
  ];
129
+ /** A single entry in a {@link bulk} search: a filter plus its per-item options. */
130
+ export type MetroBulkItem = {
131
+ filter: MetroFilter;
132
+ } & Omit<MetroSearchOptions, 'initial' | 'cache'>;
137
133
  /** The marker object distinguishing a bulk find from a single one. */
138
134
  export type MetroBulkMarker = {
139
135
  bulk: true;
@@ -144,9 +140,9 @@ export type MetroBulkModuleByName<T extends any[]> = {
144
140
  interop: false;
145
141
  }
146
142
  ? {
147
- default: Fn;
143
+ default: MetroFunction;
148
144
  }
149
- : Fn;
145
+ : MetroFunction;
150
146
  };
151
147
  /** Result shape of a bulk by-property search, one record per requested item. */
152
148
  export type MetroBulkModuleByProperty<T extends any[]> = {
@@ -157,6 +153,8 @@ export type MetroFilter = ((mdl: any, id: number | string) => PredicateResult) &
157
153
  [CACHE_KEY]?: string;
158
154
  isRaw?: boolean;
159
155
  };
156
+ /** A function or class exported by a Discord module, whose signature Discord does not document. */
157
+ export type MetroFunction = DiscordFunction & (new (...args: any[]) => any);
160
158
  /** Dispatches to the bulk or single by-name result shape based on the argument tuple. */
161
159
  export type MetroFunctionSignatureOrArray<T extends any[], U extends string> =
162
160
  T extends MetroBulkFind<U> ? MetroBulkModuleByName<T> : MetroSingleModuleByName<T>;
@@ -165,6 +163,10 @@ export type MetroInternalOptions = {
165
163
  bulk?: boolean;
166
164
  lazy?: boolean;
167
165
  };
166
+ /** Search options for {@link findLazy}, adding a `signal` that abandons the wait when aborted. */
167
+ export type MetroLazySearchOptions = {
168
+ signal?: AbortSignal;
169
+ } & Omit<MetroSearchOptions, 'lazy' | 'all'>;
168
170
  /** Convenience alias for a by-property result derived from a union of prop names. */
169
171
  export type MetroModule<TProps extends string> = MetroPropertyRecordOrArray<TProps[], TProps>;
170
172
  /** A bag carrying a `params` array of prop names. */
@@ -173,14 +175,14 @@ export type MetroParamsBag<T extends string> = {
173
175
  };
174
176
  /** A record keyed by the prop names listed in a single bulk item's `params`. */
175
177
  export type MetroParamsRecord<Params extends PropertyKey[]> = {
176
- [P in Params[number]]: any;
178
+ [P in Params[number]]: MetroExport;
177
179
  };
178
180
  /** Dispatches to the bulk or single by-property result shape based on the argument tuple. */
179
181
  export type MetroPropertyRecordOrArray<T extends any[], U extends string> =
180
182
  T extends MetroBulkFind<U> ? MetroBulkModuleByProperty<T> : MetroSingleModuleByProperty<T>;
181
183
  /** A record keyed by the non-options entries of a find argument tuple. */
182
184
  export type MetroPropsRecord<T extends any[]> = {
183
- [k in Exclude<T[number], Record<PropertyKey, any>>]: any;
185
+ [k in Exclude<T[number], object>]: MetroExport;
184
186
  };
185
187
  /** Public options accepted by {@link find} and the `findBy*` family. */
186
188
  export type MetroSearchOptions = {
@@ -205,11 +207,11 @@ export type MetroSingleModuleByName<T extends any[]> = T extends [
205
207
  interop: false;
206
208
  }
207
209
  ? {
208
- default: Fn;
210
+ default: MetroFunction;
209
211
  }
210
- : Fn
212
+ : MetroFunction
211
213
  >
212
- : Fn;
214
+ : MetroFunction;
213
215
  /** Result shape of a by-property search: a record keyed by the requested props. */
214
216
  export type MetroSingleModuleByProperty<T extends any[]> = T extends [
215
217
  ...any,
@@ -217,13 +219,17 @@ export type MetroSingleModuleByProperty<T extends any[]> = T extends [
217
219
  ]
218
220
  ? MetroAllValues<O, AnyProps<MetroPropsRecord<T>>>
219
221
  : AnyProps<MetroPropsRecord<T>>;
222
+ /** Search options for {@link findStore}, adding the `short` name-matching toggle. */
223
+ export type MetroStoreOptions = {
224
+ short?: boolean;
225
+ } & MetroSearchOptions;
220
226
  /** Tuple of search terms followed by a trailing options object. */
221
227
  export type MetroStringFindWithOptions<T extends string, Options = MetroSearchOptions> = [
222
228
  ...T[],
223
229
  Options,
224
230
  ];
231
+ export * as api from './api';
232
+ export * as common from './common';
225
233
  export * as components from './components';
226
234
  export * as filters from './filters';
227
- export * as common from './common';
228
235
  export * as stores from './stores';
229
- export * as api from './api';
@@ -2,3 +2,5 @@
2
2
 
3
3
  export declare const Guilds: any;
4
4
  export declare const Users: any;
5
+
6
+ export {};
package/src/native.d.ts CHANGED
@@ -30,8 +30,8 @@ export type {
30
30
  PluginContext,
31
31
  } from './_internal';
32
32
  import type { NativePlatformBridge, NativePluginCapability } from './_internal';
33
- import type { Fn, PromiseFn } from './utils';
34
33
  declare const NativePlatform$1: NativePlatformBridge | undefined;
34
+
35
35
  export declare class NativePluginCapabilityError extends Error {
36
36
  readonly code = 'NATIVE_PLUGIN_CAPABILITY_DENIED';
37
37
  readonly capability: NativePluginCapability;
@@ -62,21 +62,18 @@ export declare const DeviceInfo: DeviceInfoType;
62
62
  * @param names The candidate native module names to look up, in priority order.
63
63
  * @returns The first matching native module.
64
64
  */
65
- export declare function getNativeModule<T = any>(...names: string[]): T;
65
+ export declare function getNativeModule<T>(...names: string[]): T;
66
66
  /**
67
67
  * @description Reads Hermes' runtime metadata, such as the bytecode version, GC, and build channel.
68
- * React Native types the global `HermesInternal` as `null | {}`, so this reads it via
69
- * `window.HermesInternal` where our own typing wins.
70
68
  * @returns The runtime property map, or an empty object when Hermes internals are unavailable.
71
69
  */
72
- export declare function getRuntimeProperties(): Record<string, any>;
70
+ export declare function getRuntimeProperties(): HermesRuntimeProperties;
73
71
  /**
74
72
  * @description Persists pending settings to storage, then reloads the native bundle.
75
73
  */
76
74
  export declare function reload(): Promise<void>;
77
-
78
75
  /** Build and release metadata reported by the native client info module. */
79
- export interface BundleInfoType {
76
+ export type BundleInfoType = {
80
77
  Version: string;
81
78
  ReleaseChannel: string;
82
79
  Manifest: string;
@@ -87,27 +84,29 @@ export interface BundleInfoType {
87
84
  SentryStaffDsn: string;
88
85
  Identifier: string;
89
86
  SentryAlphaBetaDsn: string;
90
- }
87
+ };
91
88
  /** The native `BundleUpdaterManager` module surface for OTA updates and reloading the bundle. */
92
- export interface DCDBundleManagerType {
93
- getInitialBundleDownloaded: PromiseFn;
94
- getInitialOtaUpdateChecked: PromiseFn;
95
- checkForUpdateAndReload: Fn;
96
- reload: Fn;
97
- getOtaRootPath: PromiseFn;
98
- getBuildOverrideCookieContents: PromiseFn;
99
- setBuildOverrideCookieHeader: PromiseFn;
100
- getManifestInfo: PromiseFn;
101
- addListener: Fn;
102
- removeListeners: Fn;
103
- }
89
+ export type DCDBundleManagerType = {
90
+ getInitialBundleDownloaded: UndocumentedNativeMethod;
91
+ getInitialOtaUpdateChecked: UndocumentedNativeMethod;
92
+ checkForUpdateAndReload(): void;
93
+ reload(): void;
94
+ getOtaRootPath: UndocumentedNativeMethod;
95
+ getBuildOverrideCookieContents: UndocumentedNativeMethod;
96
+ setBuildOverrideCookieHeader: UndocumentedNativeMethod;
97
+ getManifestInfo: UndocumentedNativeMethod;
98
+ addListener(eventName: string): void;
99
+ removeListeners(count: number): void;
100
+ };
104
101
  /** The constant directory paths exposed by the native `DCDFileManager`. */
105
- export interface DCDFileManagerConstants {
102
+ export type DCDFileManagerConstants = {
106
103
  CacheDirPath: string;
107
104
  DocumentsDirPath: string;
108
- }
105
+ };
106
+ /** The text encodings accepted by the native `DCDFileManager` read/write operations. */
107
+ export type DCDFileManagerEncoding = 'utf-8' | 'utf8' | 'base64';
109
108
  /** The native `DCDFileManager` module surface for reading, writing, and inspecting files. */
110
- export interface DCDFileManagerType extends DCDFileManagerConstants {
109
+ export type DCDFileManagerType = {
111
110
  readFile(path: string, encoding: DCDFileManagerEncoding): Promise<string>;
112
111
  writeFile(
113
112
  type: 'documents' | 'cache',
@@ -115,16 +114,16 @@ export interface DCDFileManagerType extends DCDFileManagerConstants {
115
114
  data: string,
116
115
  encoding: DCDFileManagerEncoding,
117
116
  ): Promise<string>;
118
- removeFile(type: 'documents' | 'cache', path: string): Promise<any>;
119
- readAsset(): Promise<unknown>;
120
- getSize(): Promise<unknown>;
121
- getVideoDimensions(): Promise<unknown>;
117
+ removeFile(type: 'documents' | 'cache', path: string): Promise<boolean>;
118
+ readAsset: UndocumentedNativeMethod;
119
+ getSize: UndocumentedNativeMethod;
120
+ getVideoDimensions: UndocumentedNativeMethod;
122
121
  fileExists(path: string): Promise<boolean>;
123
- saveFileToGallery(): Promise<unknown>;
122
+ saveFileToGallery: UndocumentedNativeMethod;
124
123
  getConstants(): DCDFileManagerConstants;
125
- }
124
+ } & DCDFileManagerConstants;
126
125
  /** Hardware and OS details reported by the native device module. */
127
- export interface DeviceInfoType {
126
+ export type DeviceInfoType = {
128
127
  isTaskBarEnabled: boolean;
129
128
  maxCpuFreq: string;
130
129
  socName: string;
@@ -137,8 +136,10 @@ export interface DeviceInfoType {
137
136
  deviceBrand: string;
138
137
  ramSize: string;
139
138
  device: string;
140
- }
139
+ };
140
+ export type HermesRuntimeProperties = ReturnType<HermesInternalObject['getRuntimeProperties']>;
141
+ export type UndocumentedNativeMethod = () => Promise<unknown>;
141
142
 
142
- /** The text encodings accepted by the native `DCDFileManager` read/write operations. */
143
- export type DCDFileManagerEncoding = 'utf-8' | 'utf8' | 'base64';
144
143
  export { NativePlatform$1 as NativePlatform };
144
+
145
+ export {};
package/src/patcher.d.ts CHANGED
@@ -90,3 +90,5 @@ export type PatchParent = AnyFunction | AnyObject;
90
90
  export type PropOf<M> = {
91
91
  [K in keyof M]: M[K] extends AnyFunction | AnyConstructor ? Extract<K, string> : never;
92
92
  }[keyof M];
93
+
94
+ export {};
package/src/settings.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  // Auto-generated by generate-plugin-sdk.ts - DO NOT EDIT
2
2
 
3
3
  export type { SettingsEntry } from './_internal';
4
- import { ComponentType } from 'react';
5
-
6
4
  import type { SettingsEntry } from './_internal';
5
+ import * as ReactModule from 'react';
6
+ import { ComponentType } from 'react';
7
7
 
8
8
  declare const _default: {
9
9
  registerSettings: typeof registerSettings;
@@ -26,3 +26,5 @@ export declare function removeSettings(...keys: string[]): void;
26
26
  */
27
27
  export declare function sections(): Record<string, SettingsEntry>;
28
28
  export { _default as default };
29
+
30
+ export {};
package/src/storage.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  // Auto-generated by generate-plugin-sdk.ts - DO NOT EDIT
2
2
 
3
- import type { PredicateResult, Widen } from './utils';
4
3
  import type { EventEmitter } from './tseep';
4
+ import type { PredicateResult, Widen } from './utils';
5
+ import type { SettingsValue } from './_internal';
5
6
  declare const _default: {
6
7
  addListener: typeof addListener;
7
8
  get: typeof get;
@@ -58,15 +59,15 @@ export declare function get<T>(store: string, key: string, def: T): Widen<T>;
58
59
  * @returns An object exposing `get`, `set`, `toggle`, `remove`, `clear`, `useSettingsStore`, and `addListener` bound to the store.
59
60
  */
60
61
  export declare function getStore(store: string): {
61
- set: (key: string, value: any) => void;
62
+ set: (key: string, value: SettingsValue) => void;
62
63
  get: <T>(key: string, def: T) => Widen<T>;
63
- toggle: (key: string, def: any) => void;
64
+ toggle: (key: string, def: boolean) => void;
64
65
  remove: (key: string) => void;
65
66
  clear: () => void;
66
67
  useSettingsStore: (predicate?: (payload: SettingsPayload) => PredicateResult) => {
67
- set: (key: string, value: any) => void;
68
+ set: (key: string, value: SettingsValue) => void;
68
69
  get: <T>(key: string, def: T) => Widen<T>;
69
- toggle: (key: string, def: any) => void;
70
+ toggle: (key: string, def: boolean) => void;
70
71
  remove: (key: string) => void;
71
72
  };
72
73
  addListener: (
@@ -96,14 +97,14 @@ export declare function removeListener(callback: (payload: SettingsPayload) => v
96
97
  * @param key The dot-separated key path within the store.
97
98
  * @param value The value to store.
98
99
  */
99
- export declare function set(store: string, key: string, value: any): void;
100
+ export declare function set(store: string, key: string, value: SettingsValue): void;
100
101
  /**
101
102
  * @description Flips a boolean value at a key path against its current (or default) value, and emits `toggled`.
102
103
  * @param store The store to write to.
103
104
  * @param key The dot-separated key path within the store.
104
105
  * @param def The value to assume when the key is not yet set.
105
106
  */
106
- export declare function toggle(store: string, key: string, def: any): void;
107
+ export declare function toggle(store: string, key: string, def: boolean): void;
107
108
  /**
108
109
  * @description React hook that re-renders the component whenever a matching change occurs in the store.
109
110
  * @param store The store to subscribe to.
@@ -114,19 +115,11 @@ export declare function useSettingsStore(
114
115
  store: string,
115
116
  predicate?: (payload: SettingsPayload) => PredicateResult,
116
117
  ): {
117
- set: (key: string, value: any) => void;
118
+ set: (key: string, value: SettingsValue) => void;
118
119
  get: <T>(key: string, def: T) => Widen<T>;
119
- toggle: (key: string, def: any) => void;
120
+ toggle: (key: string, def: boolean) => void;
120
121
  remove: (key: string) => void;
121
122
  };
122
-
123
- /** Payload describing a settings change, passed to `changed` listeners and predicates. */
124
- export interface SettingsPayload {
125
- store: string;
126
- key: string | null;
127
- value: any;
128
- }
129
-
130
123
  export type ClearedPayload = {
131
124
  store: string;
132
125
  };
@@ -144,12 +137,20 @@ export type RemovedPayload = {
144
137
  export type SetPayload = {
145
138
  store: string;
146
139
  key: string;
147
- value: any;
140
+ value: SettingsValue;
141
+ };
142
+ /** Payload describing a settings change, passed to `changed` listeners and predicates. */
143
+ export type SettingsPayload = {
144
+ store: string;
145
+ key: string | null;
146
+ value: SettingsValue | undefined;
148
147
  };
149
148
  export type ToggledPayload = {
150
149
  store: string;
151
150
  key: string;
152
- prev: any;
153
- value: any;
151
+ prev: boolean;
152
+ value: boolean;
154
153
  };
155
154
  export { _default as default, clear$1 as clear };
155
+
156
+ export {};
package/src/toasts.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  // Auto-generated by generate-plugin-sdk.ts - DO NOT EDIT
2
2
 
3
3
  export type { ToastHandle, ToastOptions } from './_internal';
4
- import { ImageSourcePropType } from 'react-native';
5
- import { ComponentType } from 'react';
6
-
7
4
  import type { ToastHandle, ToastOptions } from './_internal';
5
+ import * as ReactModule from 'react';
6
+ import { ComponentType } from 'react';
7
+ import { ImageSourcePropType } from 'react-native';
8
8
 
9
9
  declare const _default: {
10
10
  showToast: typeof showToast;
@@ -16,3 +16,5 @@ declare const _default: {
16
16
  */
17
17
  export declare function showToast(options: ToastOptions): ToastHandle;
18
18
  export { _default as default };
19
+
20
+ export {};
package/src/tseep.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  // Auto-generated by generate-plugin-sdk.ts - DO NOT EDIT
2
2
 
3
+ import * as ReactModule from 'react';
4
+ import * as ReactNativeModule from 'react-native';
5
+
3
6
  declare class TaskCollection<
4
7
  Func extends (...args: any) => void,
5
8
  AwaitTasks extends true | false = false,
@@ -173,3 +176,5 @@ export type DefaultEventMap = {
173
176
  __proto__?: never;
174
177
  };
175
178
  export type Listener = (...args: any[]) => Promise<any> | void;
179
+
180
+ export {};
package/src/utils.d.ts CHANGED
@@ -1,26 +1,20 @@
1
1
  // Auto-generated by generate-plugin-sdk.ts - DO NOT EDIT
2
2
 
3
- /** An object of shape `T` widened with an arbitrary string/number/symbol index. */
4
- export type AnyProps<T extends Record<PropertyKey, any> = Record<PropertyKey, any>> = T &
5
- Record<PropertyKey, any>;
3
+ import * as ReactModule from 'react';
4
+ import * as ReactNativeModule from 'react-native';
6
5
  /** Any supported colour string: a {@link HexColor} or {@link RgbaColor}. */
7
6
  export type ColorString = HexColor | RgbaColor;
8
7
  /** The set of all falsy values. */
9
8
  export type Falsy = false | 0 | '' | null | undefined;
10
- /** Any function: accepts any arguments and returns `T`. */
11
- export type Fn<T = any> = (...args: any) => T;
12
9
  /** A hexadecimal colour string prefixed with `#`. */
13
10
  export type HexColor = `#${string}`;
14
11
  /**
15
- * A string union that keeps `T`'s literals for autocomplete while still accepting any other string.
16
- * Use this for Discord's open-ended enums (typography variants, colour tokens, sizes) so newly added
17
- * values keep type-checking without an update here.
12
+ * A string union that keeps `T`'s literals for autocomplete while still accepting any other string,
13
+ * for Discord's open-ended enums (typography variants, colour tokens, sizes).
18
14
  */
19
15
  export type LiteralUnion<T extends string> = T | (string & {});
20
16
  /** The result of a predicate: any {@link Truthy} or {@link Falsy} value. */
21
- export type PredicateResult = Truthy | Falsy;
22
- /** Any function returning a promise (`T` defaults to `Promise<any>`). */
23
- export type PromiseFn<T = Promise<any>> = (...args: any) => T;
17
+ export type PredicateResult = Truthy | false | null | undefined;
24
18
  /** An `rgba(...)` colour string. */
25
19
  export type RgbaColor = `rgba(${string})`;
26
20
  /** The set of all truthy values. */
@@ -33,3 +27,5 @@ export type Widen<T> = T extends number
33
27
  : T extends boolean
34
28
  ? boolean
35
29
  : T;
30
+
31
+ export {};