@topwrite/reader 1.0.22-alpha.3 → 1.0.22-alpha.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topwrite/reader",
3
- "version": "1.0.22-alpha.3+3be1f30",
3
+ "version": "1.0.22-alpha.4+414304a",
4
4
  "author": "yunwuxin <tzzhangyajun@qq.com> (https://github.com/yunwuxin)",
5
5
  "license": "ISC",
6
6
  "types": "types/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "prepack": "yarn run build"
19
19
  },
20
20
  "dependencies": {
21
- "@topwrite/common": "^1.0.20-alpha.3+3be1f30",
21
+ "@topwrite/common": "^1.0.20-alpha.4+414304a",
22
22
  "@types/lodash": "^4.14.168",
23
23
  "@types/node": "^16.4.13",
24
24
  "@types/react": "^17.0.4",
@@ -53,5 +53,5 @@
53
53
  "optional": true
54
54
  }
55
55
  },
56
- "gitHead": "3be1f30450dc6e47d8ba20991a6fefc7f92d06c3"
56
+ "gitHead": "414304ada0e714c336a574d683dda3d638dde1bd"
57
57
  }
package/types/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export * from '@topwrite/common';
4
4
  export { default as bootstrap } from './lib/bootstrap';
5
5
  export { history } from './lib/history';
6
6
  export { default as useTitle } from './lib/use-title';
7
+ export { default as useFile } from './lib/use-file';
7
8
  export { default as useArticle, usePrevArticle, useNextArticle } from './lib/use-article';
8
9
  export { default as useWindowSize, windowSizes } from './lib/use-window-size';
9
10
  export { default as useLockBodyScroll } from './lib/use-lock-body-scroll';
@@ -1,4 +1,3 @@
1
1
  export { book } from './book';
2
- export { file } from './file';
3
2
  export { page } from './page';
4
3
  export { search } from './search';
@@ -1,9 +1,10 @@
1
- import { ActionsType, Model, RequestConfig, RequestInstance } from '@topwrite/common';
1
+ import { ActionsType, File, Model, RequestConfig, RequestInstance } from '@topwrite/common';
2
2
  interface PageState {
3
3
  loading: boolean;
4
4
  error?: Error;
5
5
  request: RequestInstance;
6
6
  config: RequestConfig;
7
+ file: File;
7
8
  }
8
9
  declare type Interceptors = RequestInstance['interceptors'];
9
10
  declare class Page extends Model<PageState> {
@@ -13,13 +14,8 @@ declare class Page extends Model<PageState> {
13
14
  config: {};
14
15
  };
15
16
  subscription({ fetch }: ActionsType<Page>): void;
16
- fetch(pathname: string): AsyncGenerator<import("redux").AnyAction | Generator<import("redux").AnyAction, PageState, unknown>, any, {
17
- request: any;
18
- config: any;
19
- }>;
20
- intercept(handler: (interceptors: Interceptors) => void): Generator<Generator<import("redux").AnyAction, PageState, unknown>, void, {
21
- request: any;
22
- }>;
17
+ fetch(pathname: string): AsyncGenerator<import("redux").AnyAction, void, unknown>;
18
+ intercept(handler: (interceptors: Interceptors) => void): Generator<import("redux").AnyAction, void, unknown>;
23
19
  updateConfig(updater: (config: RequestConfig) => void): Generator<import("redux").AnyAction, void, unknown>;
24
20
  }
25
21
  export declare const page: Page;
@@ -1,7 +0,0 @@
1
- import { ActionsType, Model, File as FileType } from '@topwrite/common';
2
- declare class File extends Model<FileType> {
3
- onAction(action: any, type: any, { update }: ActionsType<File>): (...args: any[]) => Generator<any, void, unknown>;
4
- update(article: FileType): Generator<import("redux").AnyAction, void, unknown>;
5
- }
6
- export declare const file: File;
7
- export {};