@topwrite/reader 1.0.79 → 1.0.80-alpha.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.
Files changed (96) hide show
  1. package/dist/{449-c4532e.js → 101-f52e60.js} +2 -2
  2. package/dist/{449-c4532e.js.map → 101-f52e60.js.map} +1 -1
  3. package/dist/368-34ab06.js +2 -0
  4. package/dist/368-34ab06.js.map +1 -0
  5. package/dist/{454-b0e4b2.js → 848-537c13.js} +2 -2
  6. package/dist/848-537c13.js.map +1 -0
  7. package/dist/index.js +6 -6
  8. package/dist/index.js.map +1 -1
  9. package/package.json +48 -48
  10. package/types/components/anchor.d.ts +7 -7
  11. package/types/components/app.d.ts +1 -1
  12. package/types/components/article.d.ts +8 -8
  13. package/types/components/asset.d.ts +6 -6
  14. package/types/components/breadcrumb.d.ts +8 -8
  15. package/types/components/catalog.d.ts +35 -35
  16. package/types/components/html/a.d.ts +2 -2
  17. package/types/components/html/attachment.d.ts +2 -2
  18. package/types/components/html/audio.d.ts +2 -2
  19. package/types/components/html/img.d.ts +2 -2
  20. package/types/components/html/video.d.ts +2 -2
  21. package/types/components/link.d.ts +7 -7
  22. package/types/components/loading-bar/index.d.ts +1 -1
  23. package/types/components/loading-bar/loading-bar.d.ts +2 -2
  24. package/types/components/logo.d.ts +6 -6
  25. package/types/components/markdown.d.ts +2 -2
  26. package/types/components/menu.d.ts +14 -14
  27. package/types/components/nav-link.d.ts +7 -7
  28. package/types/components/page-loader.d.ts +1 -1
  29. package/types/components/page.d.ts +1 -1
  30. package/types/components/powered-by.d.ts +5 -5
  31. package/types/components/search/ask-box/form.d.ts +5 -5
  32. package/types/components/search/ask-box/index.d.ts +5 -5
  33. package/types/components/search/ask-box/screens/error-screen.d.ts +1 -1
  34. package/types/components/search/ask-box/screens/start-screen.d.ts +1 -1
  35. package/types/components/search/ask-box/state.d.ts +5 -5
  36. package/types/components/search/constants.d.ts +1 -1
  37. package/types/components/search/doc-search-button.d.ts +3 -3
  38. package/types/components/search/doc-search-modal.d.ts +4 -4
  39. package/types/components/search/doc-search.d.ts +8 -8
  40. package/types/components/search/footer.d.ts +1 -1
  41. package/types/components/search/hooks/use-keyboard-events.d.ts +9 -9
  42. package/types/components/search/hooks/use-trap-focus.d.ts +5 -5
  43. package/types/components/search/icons/ask-icon.d.ts +1 -1
  44. package/types/components/search/icons/content-icon.d.ts +1 -1
  45. package/types/components/search/icons/control-key-icon.d.ts +1 -1
  46. package/types/components/search/icons/error-icon.d.ts +1 -1
  47. package/types/components/search/icons/go-to-external-icon.d.ts +1 -1
  48. package/types/components/search/icons/index.d.ts +12 -12
  49. package/types/components/search/icons/loading-icon.d.ts +1 -1
  50. package/types/components/search/icons/no-results-icon.d.ts +1 -1
  51. package/types/components/search/icons/recent-icon.d.ts +1 -1
  52. package/types/components/search/icons/reset-icon.d.ts +1 -1
  53. package/types/components/search/icons/search-icon.d.ts +1 -1
  54. package/types/components/search/icons/select-icon.d.ts +1 -1
  55. package/types/components/search/icons/star-icon.d.ts +1 -1
  56. package/types/components/search/index.d.ts +2 -2
  57. package/types/components/search/mode-provider.d.ts +5 -5
  58. package/types/components/search/search-box/form.d.ts +5 -5
  59. package/types/components/search/search-box/index.d.ts +5 -5
  60. package/types/components/search/search-box/results.d.ts +13 -13
  61. package/types/components/search/search-box/screens/error-screen.d.ts +1 -1
  62. package/types/components/search/search-box/screens/no-result-screen.d.ts +1 -1
  63. package/types/components/search/search-box/screens/results-screen.d.ts +13 -13
  64. package/types/components/search/search-box/screens/start-screen.d.ts +5 -5
  65. package/types/components/search/search-box/state.d.ts +7 -7
  66. package/types/components/spinner.d.ts +2 -2
  67. package/types/components/to-first-article.d.ts +2 -2
  68. package/types/hello.d.ts +1 -1
  69. package/types/index.d.ts +29 -29
  70. package/types/lib/bootstrap.d.ts +3 -3
  71. package/types/lib/date.d.ts +7 -7
  72. package/types/lib/extend-entities.d.ts +6 -6
  73. package/types/lib/history.d.ts +18 -18
  74. package/types/lib/use-article.d.ts +6 -7
  75. package/types/lib/use-asset-url.d.ts +1 -1
  76. package/types/lib/use-asset.d.ts +4 -4
  77. package/types/lib/use-css.d.ts +8 -8
  78. package/types/lib/use-file.d.ts +1 -1
  79. package/types/lib/use-in-preview.d.ts +1 -1
  80. package/types/lib/use-lock-body-scroll.d.ts +1 -1
  81. package/types/lib/use-logo.d.ts +7 -7
  82. package/types/lib/use-title.d.ts +1 -1
  83. package/types/lib/use-window-scroll.d.ts +2 -2
  84. package/types/lib/use-window-size.d.ts +4 -4
  85. package/types/models/ask.d.ts +18 -18
  86. package/types/models/book.d.ts +5 -5
  87. package/types/models/index.d.ts +4 -4
  88. package/types/models/page.d.ts +28 -28
  89. package/types/models/search.d.ts +22 -22
  90. package/types/typings.d.ts +39 -39
  91. package/dist/454-b0e4b2.js.map +0 -1
  92. package/dist/659-e7416c.js +0 -2
  93. package/dist/659-e7416c.js.map +0 -1
  94. /package/dist/{449.css → 101.css} +0 -0
  95. /package/dist/{659.css → 368.css} +0 -0
  96. /package/dist/{454.css → 848.css} +0 -0
@@ -1,5 +1,5 @@
1
- interface Props {
2
- onClose(): void;
3
- }
4
- export default function Form({ onClose }: Props): import("react/jsx-runtime").JSX.Element;
5
- export {};
1
+ interface Props {
2
+ onClose(): void;
3
+ }
4
+ export default function Form({ onClose }: Props): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -1,5 +1,5 @@
1
- interface SearchBoxProps {
2
- onClose(): void;
3
- }
4
- export default function SearchBox({ onClose }: SearchBoxProps): import("react/jsx-runtime").JSX.Element;
5
- export {};
1
+ interface SearchBoxProps {
2
+ onClose(): void;
3
+ }
4
+ export default function SearchBox({ onClose }: SearchBoxProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -1,13 +1,13 @@
1
- import { SearchResult } from '../../../models/search';
2
- export interface ResultItem extends SearchResult {
3
- id: number;
4
- }
5
- interface ResultsProps {
6
- items: ResultItem[];
7
- title: string;
8
- activeIndex?: number;
9
- onItemClick(item: ResultItem): void;
10
- onActive(index: number): void;
11
- }
12
- export declare function Results({ title, items, ...props }: ResultsProps): import("react/jsx-runtime").JSX.Element;
13
- export {};
1
+ import { SearchResult } from '../../../models/search';
2
+ export interface ResultItem extends SearchResult {
3
+ id: number;
4
+ }
5
+ interface ResultsProps {
6
+ items: ResultItem[];
7
+ title: string;
8
+ activeIndex?: number;
9
+ onItemClick(item: ResultItem): void;
10
+ onActive(index: number): void;
11
+ }
12
+ export declare function Results({ title, items, ...props }: ResultsProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -1 +1 @@
1
- export declare function ErrorScreen(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function ErrorScreen(): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export declare function NoResultsScreen(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function NoResultsScreen(): import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,13 @@
1
- import { ResultItem } from '../results';
2
- import { SearchResult } from '../../../../models/search';
3
- interface ResultsScreenProps {
4
- activeIndex?: number;
5
- onItemClick: (item: SearchResult) => void;
6
- onActive: (index: number) => void;
7
- collections: {
8
- title: string;
9
- items: ResultItem[];
10
- }[];
11
- }
12
- export declare function ResultsScreen({ collections, ...props }: ResultsScreenProps): import("react/jsx-runtime").JSX.Element;
13
- export {};
1
+ import { ResultItem } from '../results';
2
+ import { SearchResult } from '../../../../models/search';
3
+ interface ResultsScreenProps {
4
+ activeIndex?: number;
5
+ onItemClick: (item: SearchResult) => void;
6
+ onActive: (index: number) => void;
7
+ collections: {
8
+ title: string;
9
+ items: ResultItem[];
10
+ }[];
11
+ }
12
+ export declare function ResultsScreen({ collections, ...props }: ResultsScreenProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -1,5 +1,5 @@
1
- interface StartScreenProps {
2
- hasCollections: boolean;
3
- }
4
- export declare function StartScreen(props: StartScreenProps): import("react/jsx-runtime").JSX.Element | null;
5
- export {};
1
+ interface StartScreenProps {
2
+ hasCollections: boolean;
3
+ }
4
+ export declare function StartScreen(props: StartScreenProps): import("react/jsx-runtime").JSX.Element | null;
5
+ export {};
@@ -1,7 +1,7 @@
1
- import { SearchResult } from '../../../models/search';
2
- export interface StateProps {
3
- activeIndex?: number;
4
- onItemClick: (item: SearchResult) => void;
5
- onActive: (index: number) => void;
6
- }
7
- export default function State(props: StateProps): import("react/jsx-runtime").JSX.Element;
1
+ import { SearchResult } from '../../../models/search';
2
+ export interface StateProps {
3
+ activeIndex?: number;
4
+ onItemClick: (item: SearchResult) => void;
5
+ onActive: (index: number) => void;
6
+ }
7
+ export default function State(props: StateProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- declare const Spinner: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
- export default Spinner;
1
+ declare const Spinner: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
+ export default Spinner;
@@ -1,2 +1,2 @@
1
- import { PropsWithChildren } from 'react';
2
- export default function ToFirstArticle({ children }: PropsWithChildren<any>): any;
1
+ import { PropsWithChildren } from 'react';
2
+ export default function ToFirstArticle({ children }: PropsWithChildren<any>): any;
package/types/hello.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const logHello: () => void;
1
+ export declare const logHello: () => void;
package/types/index.d.ts CHANGED
@@ -1,29 +1,29 @@
1
- import './typings';
2
- export * from '@topwrite/common';
3
- export { default as bootstrap } from './lib/bootstrap';
4
- export { history } from './lib/history';
5
- export { default as date } from './lib/date';
6
- export { default as useTitle } from './lib/use-title';
7
- export { default as useFile } from './lib/use-file';
8
- export { default as useAssetUrl } from './lib/use-asset-url';
9
- export { default as useAsset } from './lib/use-asset';
10
- export { default as useLogo } from './lib/use-logo';
11
- export { default as useArticle, usePrevArticle, useNextArticle } from './lib/use-article';
12
- export { default as useWindowSize, windowSizes } from './lib/use-window-size';
13
- export { default as useWindowScroll } from './lib/use-window-scroll';
14
- export { default as useLockBodyScroll } from './lib/use-lock-body-scroll';
15
- export { default as useInPreview } from './lib/use-in-preview';
16
- export { default as PoweredBy } from './components/powered-by';
17
- export { default as Logo } from './components/logo';
18
- export { default as Link } from './components/link';
19
- export { default as NavLink } from './components/nav-link';
20
- export { default as Search } from './components/search';
21
- export { default as LoadingBar } from './components/loading-bar';
22
- export { default as Anchor } from './components/anchor';
23
- export { default as Article } from './components/article';
24
- export { default as Catalog, type CatalogProps, CatalogItems } from './components/catalog';
25
- export { default as Markdown } from './components/markdown';
26
- export { default as Breadcrumb } from './components/breadcrumb';
27
- export { default as PageLoader } from './components/page-loader';
28
- export { default as ToFirstArticle } from './components/to-first-article';
29
- export type { SearchHandler, SearchResult } from './models/search';
1
+ import './typings';
2
+ export * from '@topwrite/common';
3
+ export { default as bootstrap } from './lib/bootstrap';
4
+ export { history } from './lib/history';
5
+ export { default as date } from './lib/date';
6
+ export { default as useTitle } from './lib/use-title';
7
+ export { default as useFile } from './lib/use-file';
8
+ export { default as useAssetUrl } from './lib/use-asset-url';
9
+ export { default as useAsset } from './lib/use-asset';
10
+ export { default as useLogo } from './lib/use-logo';
11
+ export { default as useArticle, usePrevArticle, useNextArticle } from './lib/use-article';
12
+ export { default as useWindowSize, windowSizes } from './lib/use-window-size';
13
+ export { default as useWindowScroll } from './lib/use-window-scroll';
14
+ export { default as useLockBodyScroll } from './lib/use-lock-body-scroll';
15
+ export { default as useInPreview } from './lib/use-in-preview';
16
+ export { default as PoweredBy } from './components/powered-by';
17
+ export { default as Logo } from './components/logo';
18
+ export { default as Link } from './components/link';
19
+ export { default as NavLink } from './components/nav-link';
20
+ export { default as Search } from './components/search';
21
+ export { default as LoadingBar } from './components/loading-bar';
22
+ export { default as Anchor } from './components/anchor';
23
+ export { default as Article } from './components/article';
24
+ export { default as Catalog, type CatalogProps, CatalogItems } from './components/catalog';
25
+ export { default as Markdown } from './components/markdown';
26
+ export { default as Breadcrumb } from './components/breadcrumb';
27
+ export { default as PageLoader } from './components/page-loader';
28
+ export { default as ToFirstArticle } from './components/to-first-article';
29
+ export type { SearchHandler, SearchResult } from './models/search';
@@ -1,3 +1,3 @@
1
- import './extend-entities';
2
- declare const _default: () => void;
3
- export default _default;
1
+ import './extend-entities';
2
+ declare const _default: () => void;
3
+ export default _default;
@@ -1,7 +1,7 @@
1
- declare global {
2
- interface Date {
3
- format(fmt: string): string;
4
- }
5
- }
6
- import dayjs from 'dayjs';
7
- export default dayjs;
1
+ declare global {
2
+ interface Date {
3
+ format(fmt: string): string;
4
+ }
5
+ }
6
+ import dayjs from 'dayjs';
7
+ export default dayjs;
@@ -1,6 +1,6 @@
1
- import { immerable } from 'immer';
2
- declare module '@topwrite/common' {
3
- interface File {
4
- [immerable]: boolean;
5
- }
6
- }
1
+ import { immerable } from 'immer';
2
+ declare module '@topwrite/common' {
3
+ interface File {
4
+ [immerable]: boolean;
5
+ }
6
+ }
@@ -1,18 +1,18 @@
1
- import { History as H, Listener, To } from 'history';
2
- export declare class History {
3
- history: H;
4
- constructor();
5
- get location(): {
6
- toString(): string;
7
- state: unknown;
8
- key: string;
9
- pathname: string;
10
- search: string;
11
- hash: string;
12
- };
13
- listen(listener: Listener): () => void;
14
- replace(location: To): void;
15
- push(location: To): void;
16
- }
17
- export declare let history: History;
18
- export declare function createHistory(): History;
1
+ import { History as H, Listener, To } from 'history';
2
+ export declare class History {
3
+ history: H;
4
+ constructor();
5
+ get location(): {
6
+ toString(): string;
7
+ state: unknown;
8
+ key: import("history").Key;
9
+ pathname: import("history").Pathname;
10
+ search: import("history").Search;
11
+ hash: import("history").Hash;
12
+ };
13
+ listen(listener: Listener): () => void;
14
+ replace(location: To): void;
15
+ push(location: To): void;
16
+ }
17
+ export declare let history: History;
18
+ export declare function createHistory(): History;
@@ -1,7 +1,6 @@
1
- /// <reference types="react" />
2
- import { SummaryArticle } from '@topwrite/common';
3
- export declare const ArticleContext: import("react").Context<SummaryArticle | undefined>;
4
- export default function useArticle(): SummaryArticle | undefined;
5
- export declare function useNextArticle(): SummaryArticle | undefined;
6
- export declare function usePrevArticle(): SummaryArticle | undefined;
7
- export declare function usePart(): import("@topwrite/common").SummaryPart | undefined;
1
+ import { SummaryArticle } from '@topwrite/common';
2
+ export declare const ArticleContext: React.Context<SummaryArticle | undefined>;
3
+ export default function useArticle(): SummaryArticle | undefined;
4
+ export declare function useNextArticle(): SummaryArticle | undefined;
5
+ export declare function usePrevArticle(): SummaryArticle | undefined;
6
+ export declare function usePart(): import("@topwrite/common").SummaryPart | undefined;
@@ -1 +1 @@
1
- export default function useAssetUrl(filename: string): string;
1
+ export default function useAssetUrl(filename: string): string;
@@ -1,4 +1,4 @@
1
- export default function useAsset(): {
2
- getUrl: (filename: string) => string;
3
- upload: (_file: File, _onProgress?: ((event: ProgressEvent) => void) | undefined) => Promise<string>;
4
- };
1
+ export default function useAsset(): {
2
+ getUrl: (filename: string) => string;
3
+ upload: (_file: File, _onProgress?: (event: ProgressEvent) => void) => Promise<string>;
4
+ };
@@ -1,8 +1,8 @@
1
- import { ReactNode } from 'react';
2
- export declare const CssContext: import("react").Context<string | undefined>;
3
- interface Props {
4
- readonly children: ReactNode;
5
- }
6
- export declare function CssProvider({ children }: Props): import("react/jsx-runtime").JSX.Element | null;
7
- export default function useCss(): string | undefined;
8
- export {};
1
+ import { ReactNode } from 'react';
2
+ export declare const CssContext: React.Context<string | undefined>;
3
+ interface Props {
4
+ readonly children: ReactNode;
5
+ }
6
+ export declare function CssProvider({ children }: Props): import("react/jsx-runtime").JSX.Element | null;
7
+ export default function useCss(): string | undefined;
8
+ export {};
@@ -1 +1 @@
1
- export default function useFile(): import("@topwrite/common").File;
1
+ export default function useFile(): import("@topwrite/common").File;
@@ -1 +1 @@
1
- export default function useInPreview(): boolean;
1
+ export default function useInPreview(): boolean;
@@ -1 +1 @@
1
- export default function useLockBodyScroll(lock?: boolean, reset?: boolean): void;
1
+ export default function useLockBodyScroll(lock?: boolean, reset?: boolean): void;
@@ -1,7 +1,7 @@
1
- import { ReactNode } from 'react';
2
- interface Props {
3
- readonly children: ReactNode;
4
- }
5
- export declare function LogoProvider({ children }: Props): import("react/jsx-runtime").JSX.Element;
6
- export default function useLogo(): string;
7
- export {};
1
+ import { ReactNode } from 'react';
2
+ interface Props {
3
+ readonly children: ReactNode;
4
+ }
5
+ export declare function LogoProvider({ children }: Props): import("react/jsx-runtime").JSX.Element;
6
+ export default function useLogo(): string;
7
+ export {};
@@ -1 +1 @@
1
- export default function useTitle(): string;
1
+ export default function useTitle(): string;
@@ -1,2 +1,2 @@
1
- export declare const useWindowScroll: (fps?: number) => number;
2
- export default useWindowScroll;
1
+ export declare const useWindowScroll: (fps?: number) => number;
2
+ export default useWindowScroll;
@@ -1,4 +1,4 @@
1
- type WindowSize = 'desktop' | 'mobile';
2
- export declare const windowSizes: Record<string, WindowSize>;
3
- export default function useWindowSize(): WindowSize;
4
- export {};
1
+ type WindowSize = 'desktop' | 'mobile';
2
+ export declare const windowSizes: Record<string, WindowSize>;
3
+ export default function useWindowSize(): WindowSize;
4
+ export {};
@@ -1,18 +1,18 @@
1
- import { Model } from '@topwrite/common';
2
- export type AskHandler = (keyword: string, part?: string) => Promise<ReadableStreamDefaultReader> | ReadableStreamDefaultReader;
3
- interface AskState {
4
- enable: boolean;
5
- handler?: AskHandler;
6
- status: 'idle' | 'loading' | 'stalled' | 'error';
7
- query: string;
8
- part?: string;
9
- answer: string;
10
- }
11
- declare class Ask extends Model<AskState> {
12
- initialState: AskState;
13
- fetch(query: string): AsyncGenerator<import("redux").AnyAction, void, unknown>;
14
- setPart(part?: string): Generator<import("redux").AnyAction, void, unknown>;
15
- setHandler(handler?: AskHandler): Generator<import("redux").AnyAction, void, unknown>;
16
- }
17
- export declare const ask: Ask;
18
- export {};
1
+ import { Model } from '@topwrite/common';
2
+ export type AskHandler = (keyword: string, part?: string) => Promise<ReadableStreamDefaultReader> | ReadableStreamDefaultReader;
3
+ interface AskState {
4
+ enable: boolean;
5
+ handler?: AskHandler;
6
+ status: 'idle' | 'loading' | 'stalled' | 'error';
7
+ query: string;
8
+ part?: string;
9
+ answer: string;
10
+ }
11
+ declare class Ask extends Model<AskState> {
12
+ initialState: AskState;
13
+ fetch(query: string): AsyncGenerator<import("redux").AnyAction, void, any>;
14
+ setPart(part?: string): Generator<import("redux").AnyAction, void, unknown>;
15
+ setHandler(handler?: AskHandler): Generator<import("redux").AnyAction, void, unknown>;
16
+ }
17
+ export declare const ask: Ask;
18
+ export {};
@@ -1,5 +1,5 @@
1
- import { Book as BookType, Model } from '@topwrite/common';
2
- declare class Book extends Model<BookType> {
3
- }
4
- export declare const book: Book;
5
- export {};
1
+ import { Book as BookType, Model } from '@topwrite/common';
2
+ declare class Book extends Model<BookType> {
3
+ }
4
+ export declare const book: Book;
5
+ export {};
@@ -1,4 +1,4 @@
1
- export { book } from './book';
2
- export { page } from './page';
3
- export { search } from './search';
4
- export { ask } from './ask';
1
+ export { book } from './book';
2
+ export { page } from './page';
3
+ export { search } from './search';
4
+ export { ask } from './ask';
@@ -1,28 +1,28 @@
1
- import { ActionsType, File, Model, RequestConfig, RequestInstance } from '@topwrite/common';
2
- interface PageState {
3
- loading: boolean;
4
- error?: Error;
5
- request: RequestInstance;
6
- config: RequestConfig;
7
- file: File;
8
- lfs?: {
9
- url: string;
10
- files: {
11
- [index: string]: string;
12
- };
13
- };
14
- }
15
- type Interceptors = RequestInstance['interceptors'];
16
- declare class Page extends Model<PageState> {
17
- initialState: {
18
- loading: boolean;
19
- request: import("axios").AxiosInstance;
20
- config: {};
21
- };
22
- subscription({ fetch }: ActionsType<Page>): void;
23
- fetch(pathname: string): AsyncGenerator<import("redux").AnyAction, void, unknown>;
24
- intercept(handler: (interceptors: Interceptors) => void): Generator<import("redux").AnyAction, void, unknown>;
25
- updateConfig(updater: (config: RequestConfig) => void): Generator<import("redux").AnyAction, void, unknown>;
26
- }
27
- export declare const page: Page;
28
- export {};
1
+ import { ActionsType, File, Model, RequestConfig, RequestInstance } from '@topwrite/common';
2
+ interface PageState {
3
+ loading: boolean;
4
+ error?: Error;
5
+ request: RequestInstance;
6
+ config: RequestConfig;
7
+ file: File;
8
+ lfs?: {
9
+ url: string;
10
+ files: {
11
+ [index: string]: string;
12
+ };
13
+ };
14
+ }
15
+ type Interceptors = RequestInstance['interceptors'];
16
+ declare class Page extends Model<PageState> {
17
+ initialState: {
18
+ loading: boolean;
19
+ request: import("axios").AxiosInstance;
20
+ config: {};
21
+ };
22
+ subscription({ fetch }: ActionsType<Page>): void;
23
+ fetch(pathname: string): AsyncGenerator<import("redux").AnyAction, void, any>;
24
+ intercept(handler: (interceptors: Interceptors) => void): Generator<import("redux").AnyAction, void, any>;
25
+ updateConfig(updater: (config: RequestConfig) => void): Generator<import("redux").AnyAction, void, unknown>;
26
+ }
27
+ export declare const page: Page;
28
+ export {};
@@ -1,22 +1,22 @@
1
- import { Model } from '@topwrite/common';
2
- export interface SearchResult {
3
- title: string;
4
- path: string;
5
- body?: string;
6
- }
7
- export type SearchHandler = (keyword: string, part?: string) => Promise<SearchResult[]> | SearchResult[];
8
- interface SearchState {
9
- handler?: SearchHandler;
10
- results: SearchResult[];
11
- part?: string;
12
- query: string;
13
- status: 'loading' | 'error' | 'idle';
14
- }
15
- declare class Search extends Model<SearchState> {
16
- initialState: SearchState;
17
- fetch(query: string): AsyncGenerator<import("redux").AnyAction, void, unknown>;
18
- setPart(part?: string): Generator<import("redux").AnyAction, void, unknown>;
19
- setHandler(handler?: SearchHandler): Generator<import("redux").AnyAction, void, unknown>;
20
- }
21
- export declare const search: Search;
22
- export {};
1
+ import { Model } from '@topwrite/common';
2
+ export interface SearchResult {
3
+ title: string;
4
+ path: string;
5
+ body?: string;
6
+ }
7
+ export type SearchHandler = (keyword: string, part?: string) => Promise<SearchResult[]> | SearchResult[];
8
+ interface SearchState {
9
+ handler?: SearchHandler;
10
+ results: SearchResult[];
11
+ part?: string;
12
+ query: string;
13
+ status: 'loading' | 'error' | 'idle';
14
+ }
15
+ declare class Search extends Model<SearchState> {
16
+ initialState: SearchState;
17
+ fetch(query: string): AsyncGenerator<import("redux").AnyAction, void, any>;
18
+ setPart(part?: string): Generator<import("redux").AnyAction, void, unknown>;
19
+ setHandler(handler?: SearchHandler): Generator<import("redux").AnyAction, void, unknown>;
20
+ }
21
+ export declare const search: Search;
22
+ export {};
@@ -1,39 +1,39 @@
1
- import { Actions, AnyAction, ComponentDescriptorType, States } from '@topwrite/common';
2
- import * as models from './models';
3
- import { ComponentProps } from 'react';
4
- import Markdown from './components/markdown';
5
- import { MenuItemProps, MenuProps } from './components/menu';
6
- import Color from 'color';
7
- type Models = typeof models;
8
- declare module '@topwrite/common' {
9
- function useSelector<T extends keyof Models>(model: T): States<T, Models>[T];
10
- function useActions<T extends keyof Models>(model: T): Actions<T, Models>[T];
11
- function useModel<T extends keyof Models>(model: T): [States<T, Models>[T], Actions<T, Models>[T]];
12
- interface Model {
13
- getState<T extends keyof Models>(model: T): Generator<AnyAction, States<T, Models>[T]>;
14
- }
15
- interface OptionsStateType {
16
- preview: boolean;
17
- poweredBy: false | {
18
- name: string;
19
- link: string;
20
- };
21
- }
22
- interface ComponentsMap {
23
- 'page': ComponentDescriptorType;
24
- 'page:menu': ComponentDescriptorType<MenuProps>;
25
- 'page:menu:item': ComponentDescriptorType<MenuItemProps>;
26
- 'page:article:before': ComponentDescriptorType;
27
- 'page:article:after': ComponentDescriptorType;
28
- 'page:article:aside:before': ComponentDescriptorType;
29
- 'page:article:aside:after': ComponentDescriptorType;
30
- 'page:article:markdown': ComponentDescriptorType<ComponentProps<typeof Markdown>>;
31
- 'page:asset': ComponentDescriptorType;
32
- }
33
- interface OptionsStateType {
34
- }
35
- interface ThemeType {
36
- primaryColor: Color;
37
- }
38
- }
39
- export {};
1
+ import { Actions, AnyAction, ComponentDescriptorType, States } from '@topwrite/common';
2
+ import * as models from './models';
3
+ import { ComponentProps } from 'react';
4
+ import Markdown from './components/markdown';
5
+ import { MenuItemProps, MenuProps } from './components/menu';
6
+ import Color from 'color';
7
+ type Models = typeof models;
8
+ declare module '@topwrite/common' {
9
+ function useSelector<T extends keyof Models>(model: T): States<T, Models>[T];
10
+ function useActions<T extends keyof Models>(model: T): Actions<T, Models>[T];
11
+ function useModel<T extends keyof Models>(model: T): [States<T, Models>[T], Actions<T, Models>[T]];
12
+ interface Model {
13
+ getState<T extends keyof Models>(model: T): Generator<AnyAction, States<T, Models>[T]>;
14
+ }
15
+ interface OptionsStateType {
16
+ preview: boolean;
17
+ poweredBy: false | {
18
+ name: string;
19
+ link: string;
20
+ };
21
+ }
22
+ interface ComponentsMap {
23
+ 'page': ComponentDescriptorType;
24
+ 'page:menu': ComponentDescriptorType<MenuProps>;
25
+ 'page:menu:item': ComponentDescriptorType<MenuItemProps>;
26
+ 'page:article:before': ComponentDescriptorType;
27
+ 'page:article:after': ComponentDescriptorType;
28
+ 'page:article:aside:before': ComponentDescriptorType;
29
+ 'page:article:aside:after': ComponentDescriptorType;
30
+ 'page:article:markdown': ComponentDescriptorType<ComponentProps<typeof Markdown>>;
31
+ 'page:asset': ComponentDescriptorType;
32
+ }
33
+ interface OptionsStateType {
34
+ }
35
+ interface ThemeType {
36
+ primaryColor: Color;
37
+ }
38
+ }
39
+ export {};