@rohal12/twee-ts 1.18.0 → 1.18.2

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/dist/index.d.cts CHANGED
@@ -158,8 +158,9 @@ interface Story {
158
158
  twine1: Twine1Metadata;
159
159
  twine2: Twine2Metadata;
160
160
  }
161
- type ReadonlyPassage = Readonly<Passage> & {
161
+ type ReadonlyPassage = Readonly<Omit<Passage, 'tags' | 'metadata'>> & {
162
162
  readonly tags: readonly string[];
163
+ readonly metadata?: Readonly<PassageMetadata>;
163
164
  };
164
165
  type ReadonlyStory = Readonly<Omit<Story, 'passages' | 'twine1' | 'twine2'>> & {
165
166
  readonly passages: readonly ReadonlyPassage[];
@@ -582,7 +583,7 @@ export declare const CONFIG_FILENAME = "twee-ts.config.json";
582
583
  *
583
584
  * @param diagnostics Receives warnings that do not stop the config from loading: keys the config does not
584
585
  * define, and a file that is not valid UTF-8 (it is read as Windows-1252).
585
- * @throws When the file is not valid JSON or fails {@link validateConfig}.
586
+ * @throws When the file exists but cannot be read, is not valid JSON or fails {@link validateConfig}.
586
587
  */
587
588
  export declare function loadConfig(dir?: string, diagnostics?: Diagnostic[]): TweeTsConfig | null;
588
589
  /**
@@ -613,8 +614,10 @@ export declare function scaffoldConfig(): string;
613
614
  /** Get the cache directory for downloaded story formats. */
614
615
  export declare function getCacheDir(): string;
615
616
  /**
616
- * Download a format, verify its checksum, write it to the cache shared by name and version, and
617
- * return its StoryFormatInfo. Concurrent calls for one download URL share one request.
617
+ * Download a format, verify its checksum, check that it is the format the entry names, write it to
618
+ * the cache shared by name and version, and return its StoryFormatInfo. Concurrent calls for one
619
+ * download URL share one request for the bytes; each call then verifies them against its own
620
+ * entry, within its own timeout.
618
621
  */
619
622
  export declare function fetchAndCacheFormat(entry: SFAIndexEntry, downloadUrl: string, options?: RemoteFetchOptions): Promise<StoryFormatInfo>;
620
623
  /**
package/dist/index.d.ts CHANGED
@@ -158,8 +158,9 @@ interface Story {
158
158
  twine1: Twine1Metadata;
159
159
  twine2: Twine2Metadata;
160
160
  }
161
- type ReadonlyPassage = Readonly<Passage> & {
161
+ type ReadonlyPassage = Readonly<Omit<Passage, 'tags' | 'metadata'>> & {
162
162
  readonly tags: readonly string[];
163
+ readonly metadata?: Readonly<PassageMetadata>;
163
164
  };
164
165
  type ReadonlyStory = Readonly<Omit<Story, 'passages' | 'twine1' | 'twine2'>> & {
165
166
  readonly passages: readonly ReadonlyPassage[];
@@ -582,7 +583,7 @@ export declare const CONFIG_FILENAME = "twee-ts.config.json";
582
583
  *
583
584
  * @param diagnostics Receives warnings that do not stop the config from loading: keys the config does not
584
585
  * define, and a file that is not valid UTF-8 (it is read as Windows-1252).
585
- * @throws When the file is not valid JSON or fails {@link validateConfig}.
586
+ * @throws When the file exists but cannot be read, is not valid JSON or fails {@link validateConfig}.
586
587
  */
587
588
  export declare function loadConfig(dir?: string, diagnostics?: Diagnostic[]): TweeTsConfig | null;
588
589
  /**
@@ -613,8 +614,10 @@ export declare function scaffoldConfig(): string;
613
614
  /** Get the cache directory for downloaded story formats. */
614
615
  export declare function getCacheDir(): string;
615
616
  /**
616
- * Download a format, verify its checksum, write it to the cache shared by name and version, and
617
- * return its StoryFormatInfo. Concurrent calls for one download URL share one request.
617
+ * Download a format, verify its checksum, check that it is the format the entry names, write it to
618
+ * the cache shared by name and version, and return its StoryFormatInfo. Concurrent calls for one
619
+ * download URL share one request for the bytes; each call then verifies them against its own
620
+ * entry, within its own timeout.
618
621
  */
619
622
  export declare function fetchAndCacheFormat(entry: SFAIndexEntry, downloadUrl: string, options?: RemoteFetchOptions): Promise<StoryFormatInfo>;
620
623
  /**