@nypl/web-reader 0.2.0-alpha.8 → 0.2.0-alpha.9

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,9 +1,6 @@
1
- export declare type PublicationConfig = {
2
- manifestUrl: string;
3
- proxyUrl?: string;
4
- };
1
+ import { PublicationConfig } from './types';
5
2
  /**
6
- * Will add all publication resources to the cache so they
7
- * can be picked up by the SW.
3
+ * Sends a message to the SW to fetch and cache publication resources
4
+ * in a separate thread.
8
5
  */
9
6
  export default function usePublicationSW(publications: PublicationConfig[]): void;
@@ -1,3 +1,4 @@
1
1
  export declare const WEBPUB_CACHE_NAME = "webpub-cache";
2
2
  export declare const AGE_HEADER = "sw-fetched-on";
3
+ export declare const PRECACHE_PUBLICATIONS = "PRECACHE_PUBLICATIONS";
3
4
  export declare const CACHE_EXPIRATION_SECONDS: number;
@@ -1,3 +1,12 @@
1
+ import { PRECACHE_PUBLICATIONS } from './constants';
1
2
  export declare type WebReaderSWConfig = {
2
3
  cacheExpirationSeconds?: number;
3
4
  };
5
+ export declare type PublicationConfig = {
6
+ manifestUrl: string;
7
+ proxyUrl?: string;
8
+ };
9
+ export declare type PrecachePublicationsMessage = {
10
+ type: typeof PRECACHE_PUBLICATIONS;
11
+ publications: PublicationConfig[];
12
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nypl/web-reader",
3
- "version": "0.2.0-alpha.8",
3
+ "version": "0.2.0-alpha.9",
4
4
  "license": "MIT",
5
5
  "repository": "https://github.com/NYPL-Simplified/web-reader",
6
6
  "homepage": "https://github.com/NYPL-Simplified/web-reader",