obsidian-typings 2.2.1-beta.26 → 2.2.1-beta.28

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/types.d.ts +90 -88
  2. package/package.json +1 -1
package/dist/types.d.ts CHANGED
@@ -3104,69 +3104,21 @@ export interface RecentFileTracker {
3104
3104
  serialize(): string[];
3105
3105
  }
3106
3106
  /** @public */
3107
- export interface MetadataTypeManagerPropertiesRecord extends Record<string, PropertyInfo> {
3108
- }
3109
- /** @public */
3110
- export interface MetadataTypeManagerRegisteredTypeWidgetsRecord extends Record<PropertyWidgetType, PropertyWidget<unknown>> {
3111
- }
3112
- /** @public */
3113
- export interface MetadataTypeManagerTypesRecord extends Record<string, PropertyWidgetType> {
3107
+ export interface CustomArrayDictDataRecord<T> extends Record<string, T[]> {
3114
3108
  }
3109
+ /** @todo Documentation incomplete */
3115
3110
  /** @public */
3116
- export interface MetadataTypeManager extends Events {
3117
- /**
3118
- * Reference to App
3119
- */
3120
- app: App;
3121
- /**
3122
- * Registered properties of the vault
3123
- */
3124
- properties: MetadataTypeManagerPropertiesRecord;
3125
- /** @internal Registered type widgets */
3126
- registeredTypeWidgets: MetadataTypeManagerRegisteredTypeWidgetsRecord;
3127
- /**
3128
- * Associated widget types for each property
3129
- */
3130
- types: MetadataTypeManagerTypesRecord;
3131
- /**
3132
- * Get all registered properties of the vault
3133
- */
3134
- getAllProperties(): Record<string, PropertyInfo>;
3135
- /**
3136
- * Get assigned widget type for property
3137
- */
3138
- getAssignedType(property: string): PropertyWidgetType | null;
3139
- /**
3140
- * Get info for property
3141
- */
3142
- getPropertyInfo(property: string): PropertyInfo;
3143
- /** @internal Get expected widget type for property and the one inferred from the property value */
3144
- getTypeInfo(arg: {
3145
- key: string;
3146
- type: string;
3147
- value: unknown;
3148
- }): {
3149
- inferred: PropertyWidget<unknown>;
3150
- expected: PropertyWidget<unknown>;
3151
- };
3152
- /**
3153
- * Get all properties with an assigned widget type
3154
- */
3155
- getTypes(): string[];
3156
- /** @internal Load property types from config */
3157
- loadData(): Promise<void>;
3158
- /** @internal */
3159
- onRaw(e: unknown): void;
3160
- /** @internal */
3161
- registerListeners(): void;
3162
- /** @internal Save property types to config */
3163
- save(): Promise<void>;
3164
- /** @internal Get all properties from metadata cache */
3165
- savePropertyInfo(): void;
3166
- /** @internal Set widget type for property */
3167
- setType(property: string, type: PropertyWidgetType): Promise<void>;
3168
- /** @internal Unset widget type for property */
3169
- unsetType(property: string): Promise<void>;
3111
+ export interface CustomArrayDict<T> {
3112
+ data: CustomArrayDictDataRecord<T>;
3113
+ add(key: string, value: T): void;
3114
+ clear(key: string): void;
3115
+ clearAll(): void;
3116
+ contains(key: string, value: T): boolean;
3117
+ count(): number;
3118
+ get(key: string): T[] | null;
3119
+ keys(): string[];
3120
+ remove(key: string, value: T): void;
3121
+ removeKey(key: string): void;
3170
3122
  }
3171
3123
  /**
3172
3124
  * @public
@@ -3200,23 +3152,6 @@ export interface LinkResolverQueue {
3200
3152
  remove(file: TFile): void;
3201
3153
  }
3202
3154
  /** @public */
3203
- export interface CustomArrayDictDataRecord<T> extends Record<string, T[]> {
3204
- }
3205
- /** @todo Documentation incomplete */
3206
- /** @public */
3207
- export interface CustomArrayDict<T> {
3208
- data: CustomArrayDictDataRecord<T>;
3209
- add(key: string, value: T): void;
3210
- clear(key: string): void;
3211
- clearAll(): void;
3212
- contains(key: string, value: T): boolean;
3213
- count(): number;
3214
- get(key: string): T[] | null;
3215
- keys(): string[];
3216
- remove(key: string, value: T): void;
3217
- removeKey(key: string): void;
3218
- }
3219
- /** @public */
3220
3155
  export interface MetadataCacheFileCacheRecord extends Record<string, FileCacheEntry> {
3221
3156
  }
3222
3157
  /** @public */
@@ -3245,13 +3180,13 @@ declare module "obsidian" {
3245
3180
  /** @internal File hash to metadata cache entry mapping */
3246
3181
  metadataCache: MetadataCacheMetadataCacheRecord;
3247
3182
  /** @internal Callbacks to execute on cache clean */
3248
- onCleanCacheCallbacks: unknown[];
3183
+ onCleanCacheCallbacks: (() => void)[];
3249
3184
  /** @internal Mapping of filename to collection of files that share the same name */
3250
3185
  uniqueFileLookup: CustomArrayDict<TFile>;
3251
3186
  /** @internal */
3252
- userIgnoreFilterCache: unknown;
3187
+ userIgnoreFilterCache: Record<string, boolean>;
3253
3188
  /** @internal */
3254
- userIgnoreFilters: unknown;
3189
+ userIgnoreFilters: RegExp[] | null;
3255
3190
  /** @internal */
3256
3191
  userIgnoreFiltersString: string;
3257
3192
  /**
@@ -3261,14 +3196,14 @@ declare module "obsidian" {
3261
3196
  /** @internal */
3262
3197
  worker: Worker;
3263
3198
  /** @internal */
3264
- workerResolve: unknown;
3199
+ workerResolve: ((value: CachedMetadata | PromiseLike<CachedMetadata>) => void) | null;
3265
3200
  /** @internal */
3266
- workQueue: unknown;
3201
+ workQueue: PromisedQueue;
3267
3202
  _getLinkpathDest(origin: string, path: string): TFile[];
3268
3203
  /** @internal Clear all caches to null values */
3269
3204
  cleanupDeletedCache(): void;
3270
3205
  /** @internal */
3271
- clear(): unknown;
3206
+ clear(): Promise<void>;
3272
3207
  /** @internal */
3273
3208
  computeMetadataAsync(arrayBuffer: ArrayBuffer): Promise<void>;
3274
3209
  /** @internal Remove all entries that contain deleted path */
@@ -3317,7 +3252,7 @@ declare module "obsidian" {
3317
3252
  /** @internal Check whether file can support metadata (by checking extension support) */
3318
3253
  isSupportedFile(file: TFile): boolean;
3319
3254
  /** @internal Check whether string is part of the user ignore filters */
3320
- isUserIgnored(filter: unknown): boolean;
3255
+ isUserIgnored(path: string): boolean;
3321
3256
  /**
3322
3257
  * Iterate over all link references in the vault with callback
3323
3258
  */
@@ -3335,7 +3270,7 @@ declare module "obsidian" {
3335
3270
  */
3336
3271
  on(name: "initialized", callback: () => void): EventRef;
3337
3272
  /** @internal Execute onCleanCache callbacks if cache is clean */
3338
- onCleanCache(): void;
3273
+ onCleanCache(onCleanCacheCallback: () => void): void;
3339
3274
  /** @internal On creation of the cache: update metadata cache */
3340
3275
  onCreate(file: TAbstractFile): void;
3341
3276
  /** @internal On creation or modification of the cache: update metadata cache */
@@ -3343,11 +3278,13 @@ declare module "obsidian" {
3343
3278
  /** @internal On deletion of the cache: update metadata cache */
3344
3279
  onDelete(file: TAbstractFile): void;
3345
3280
  /** @internal */
3346
- onReceiveMessageFromWorker(e: unknown): void;
3281
+ onReceiveMessageFromWorker(message: {
3282
+ data: CachedMetadata;
3283
+ }): void;
3347
3284
  /** @internal On rename of the cache: update metadata cache */
3348
3285
  onRename(file: TAbstractFile, oldPath: string): void;
3349
3286
  /** @internal Check editor for unresolved links and mark these as unresolved */
3350
- resolveLinks(editor: Element): void;
3287
+ resolveLinks(path: string): void;
3351
3288
  /** @internal Update file cache entry and sync to indexedDB */
3352
3289
  saveFileCache(path: string, entry: FileCacheEntry): void;
3353
3290
  /** @internal Update metadata cache entry and sync to indexedDB */
@@ -6376,6 +6313,71 @@ export interface InternalPlugins extends Events {
6376
6313
  saveConfig(): Promise<void>;
6377
6314
  }
6378
6315
  /** @public */
6316
+ export interface MetadataTypeManagerPropertiesRecord extends Record<string, PropertyInfo> {
6317
+ }
6318
+ /** @public */
6319
+ export interface MetadataTypeManagerRegisteredTypeWidgetsRecord extends Record<PropertyWidgetType, PropertyWidget<unknown>> {
6320
+ }
6321
+ /** @public */
6322
+ export interface MetadataTypeManagerTypesRecord extends Record<string, PropertyWidgetType> {
6323
+ }
6324
+ /** @public */
6325
+ export interface MetadataTypeManager extends Events {
6326
+ /**
6327
+ * Reference to App
6328
+ */
6329
+ app: App;
6330
+ /**
6331
+ * Registered properties of the vault
6332
+ */
6333
+ properties: MetadataTypeManagerPropertiesRecord;
6334
+ /** @internal Registered type widgets */
6335
+ registeredTypeWidgets: MetadataTypeManagerRegisteredTypeWidgetsRecord;
6336
+ /**
6337
+ * Associated widget types for each property
6338
+ */
6339
+ types: MetadataTypeManagerTypesRecord;
6340
+ /**
6341
+ * Get all registered properties of the vault
6342
+ */
6343
+ getAllProperties(): Record<string, PropertyInfo>;
6344
+ /**
6345
+ * Get assigned widget type for property
6346
+ */
6347
+ getAssignedType(property: string): PropertyWidgetType | null;
6348
+ /**
6349
+ * Get info for property
6350
+ */
6351
+ getPropertyInfo(property: string): PropertyInfo;
6352
+ /** @internal Get expected widget type for property and the one inferred from the property value */
6353
+ getTypeInfo(arg: {
6354
+ key: string;
6355
+ type: string;
6356
+ value: unknown;
6357
+ }): {
6358
+ inferred: PropertyWidget<unknown>;
6359
+ expected: PropertyWidget<unknown>;
6360
+ };
6361
+ /**
6362
+ * Get all properties with an assigned widget type
6363
+ */
6364
+ getTypes(): string[];
6365
+ /** @internal Load property types from config */
6366
+ loadData(): Promise<void>;
6367
+ /** @internal */
6368
+ onRaw(e: unknown): void;
6369
+ /** @internal */
6370
+ registerListeners(): void;
6371
+ /** @internal Save property types to config */
6372
+ save(): Promise<void>;
6373
+ /** @internal Get all properties from metadata cache */
6374
+ savePropertyInfo(): void;
6375
+ /** @internal Set widget type for property */
6376
+ setType(property: string, type: PropertyWidgetType): Promise<void>;
6377
+ /** @internal Unset widget type for property */
6378
+ unsetType(property: string): Promise<void>;
6379
+ }
6380
+ /** @public */
6379
6381
  export interface PluginsManifestsRecord extends Record<string, PluginManifest> {
6380
6382
  }
6381
6383
  /** @public */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obsidian-typings",
3
- "version": "2.2.1-beta.26",
3
+ "version": "2.2.1-beta.28",
4
4
  "description": "Extended type definitions for the Obsidian API (https://obsidian.md)",
5
5
  "main": "",
6
6
  "module": "",