delta-comic-core 0.0.6 → 0.0.8

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/pack.tgz CHANGED
Binary file
@@ -3,7 +3,7 @@ import { ProcessInstance } from '../struct/image';
3
3
  import { CommentRow } from '../struct/comment';
4
4
  import { UserCardComp } from '../struct/user';
5
5
  import { RStream, RPromiseContent } from '../utils/data';
6
- import { Item, RawItem } from '../struct/item';
6
+ import { Item, RawItem, Author } from '../struct/item';
7
7
  import { Component, MaybeRefOrGetter } from 'vue';
8
8
  import { ConfigPointer } from '../config';
9
9
  export type PluginDefineResult = {
@@ -27,14 +27,27 @@ export interface PluginConfig {
27
27
  * 传入`Store.ConfigPointer`
28
28
  */
29
29
  config?: ConfigPointer[];
30
+ subscribe?: Record<string, PluginConfigSubscribe>;
31
+ }
32
+ export interface PluginConfigSubscribe {
33
+ getUpdateList(olds: {
34
+ author: Author;
35
+ list: Item[];
36
+ }[], signal?: AbortSignal): PromiseLike<{
37
+ isUpdated: boolean;
38
+ whichUpdated: Author[];
39
+ }>;
40
+ onAdd?(author: Author): any;
41
+ onRemove?(author: Author): any;
42
+ getListStream(author: Author): RStream<Item>;
30
43
  }
31
44
  export interface PluginOtherProgress {
32
45
  call: (setDescription: (description: string) => void) => PromiseLike<any>;
33
46
  name: string;
34
47
  }
35
48
  export interface PluginConfigUser {
36
- edit: Component;
37
- card: UserCardComp;
49
+ edit?: Component;
50
+ card?: UserCardComp;
38
51
  /**
39
52
  * 1. download
40
53
  * 2. upload (收藏那些云端未收藏的漫画)
@@ -47,6 +60,12 @@ export interface PluginConfigUser {
47
60
  * 在用户界面,在历史记录那个板块的下方,你希望展示的自己的板块
48
61
  */
49
62
  userActionPages?: PluginUserActionPage[];
63
+ authorActions?: Record<string, AuthorAction>;
64
+ }
65
+ export interface AuthorAction {
66
+ call(author: Author): any;
67
+ name: string;
68
+ icon?: Component;
50
69
  }
51
70
  export interface PluginUserActionPage {
52
71
  title?: string;
@@ -121,10 +140,10 @@ export interface PluginConfigSearchMethod {
121
140
  }[];
122
141
  defaultSort: string;
123
142
  getStream(input: string, sort: string): RStream<Item>;
124
- getAutoComplete(input: string, signal: AbortSignal): PromiseLike<{
143
+ getAutoComplete(input: string, signal: AbortSignal): PromiseLike<({
125
144
  text: string;
126
145
  value: string;
127
- }[]>;
146
+ } | Component)[]>;
128
147
  }
129
148
  export interface PluginConfigApi {
130
149
  forks: () => (PromiseLike<string[]> | string[]);
@@ -1,6 +1,7 @@
1
1
  import { Component, StyleValue } from 'vue';
2
2
  import { RStream } from '../utils/data';
3
3
  import { uni } from '.';
4
+ import { AudioSrc, MediaSrc, TextTrackInit } from 'vidstack';
4
5
  import { PluginConfigSearchCategory, PluginConfigSearchHotPageLevelboard, PluginConfigSearchHotPageMainList, PluginConfigSearchHotPageTopButton, PluginConfigSearchTabbar } from '../plugin/define';
5
6
  import * as item from './item';
6
7
  import * as ep from './ep';
@@ -83,3 +84,12 @@ export type ItemCardComp = Component<{
83
84
  smallTopInfo(): void;
84
85
  cover(): void;
85
86
  }>;
87
+ export type VideoConfig = {
88
+ textTrack?: TextTrackInit[];
89
+ } & (Exclude<MediaSrc, string | AudioSrc>[]);
90
+ export declare abstract class ContentImagePage extends ContentPage {
91
+ images: import('../utils/data').PromiseWithResolvers<uni.image.Image[]>;
92
+ }
93
+ export declare abstract class ContentVideoPage extends ContentPage {
94
+ videos: import('../utils/data').PromiseWithResolvers<uni.content.VideoConfig>;
95
+ }
@@ -2,6 +2,7 @@ import { Struct, MetaData } from '../utils/data';
2
2
  import { default as dayjs } from 'dayjs';
3
3
  import { ContentType, ContentType_ } from './content';
4
4
  import { Ep, RawEp } from './ep';
5
+ import { Component } from 'vue';
5
6
  import * as image from "./image";
6
7
  export interface Category {
7
8
  name: string;
@@ -12,13 +13,24 @@ export interface Category {
12
13
  sort: string;
13
14
  };
14
15
  }
16
+ export interface Author {
17
+ label: string;
18
+ icon: image.RawImage | Component;
19
+ description: string;
20
+ /**
21
+ * 为空则不可订阅
22
+ * 否则传入的为`defineConfig`中定义的`subscribe.type`
23
+ */ subscribe?: string;
24
+ actions?: string[];
25
+ $$meta?: MetaData;
26
+ }
15
27
  export interface RawItem {
16
28
  cover: image.RawImage;
17
29
  title: string;
18
30
  id: string;
19
31
  /** @alias tags */
20
32
  categories: Category[];
21
- author: string[];
33
+ author: Author[];
22
34
  viewNumber?: number;
23
35
  likeNumber?: number;
24
36
  commentNumber?: number;
@@ -45,7 +57,7 @@ export declare abstract class Item extends Struct<RawItem> implements RawItem {
45
57
  title: string;
46
58
  id: string;
47
59
  categories: Category[];
48
- author: string[];
60
+ author: Author[];
49
61
  viewNumber?: number;
50
62
  likeNumber?: number;
51
63
  commentNumber?: number;
@@ -1,3 +1,4 @@
1
+ import { AuthorAction, PluginConfigSubscribe } from '../plugin/define';
1
2
  import { uni } from '.';
2
3
  import { Image, RawImage } from './image';
3
4
  import { Component } from 'vue';
@@ -10,6 +11,12 @@ export interface RawUser {
10
11
  export declare abstract class User {
11
12
  static userBase: import('vue').ShallowReactive<Map<string, uni.user.User>>;
12
13
  static userEditorBase: import('vue').ShallowReactive<Map<string, Component>>;
14
+ static subscribes: import('vue').ShallowReactive<Map<string, PluginConfigSubscribe>>;
15
+ static setSubscribes(plugin: string, type: string, config: PluginConfigSubscribe): void;
16
+ static getSubscribes(plugin: string, type: string): PluginConfigSubscribe | undefined;
17
+ static authorActions: import('vue').ShallowReactive<Map<string, AuthorAction>>;
18
+ static setAuthorActions(plugin: string, type: string, config: AuthorAction): void;
19
+ static getAuthorActions(plugin: string, type: string): AuthorAction | undefined;
13
20
  constructor(v: RawUser);
14
21
  avatar?: Image;
15
22
  name: string;
@@ -38,7 +38,9 @@ export declare namespace utilInterceptors {
38
38
  const _ = 1;
39
39
  }
40
40
  export type Requester = ReturnType<typeof createAxios>;
41
- export declare const createAxios: (fork: () => Promise<string> | string, config?: CreateAxiosDefaults, middle?: (axios: AxiosInstance) => AxiosInstance) => {
41
+ export declare const createAxios: (fork: () => Promise<string> | string, config?: CreateAxiosDefaults & Partial<{
42
+ noPassClientError: boolean;
43
+ }>, middle?: (axios: AxiosInstance) => AxiosInstance) => {
42
44
  get: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
43
45
  post: <T>(url: string, data?: any, config?: AxiosRequestConfig) => Promise<T>;
44
46
  postForm: <T>(url: string, data?: any, config?: AxiosRequestConfig) => Promise<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "delta-comic-core",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "我曾亲眼见证神的熟视无睹.",
5
5
  "homepage": "https://github.com/wenxig/delta-comic-core",
6
6
  "repository": {
@@ -18,12 +18,13 @@
18
18
  "@vueuse/core": "14.0.0",
19
19
  "dayjs": "^1.11.18",
20
20
  "mitt": "^3.0.1",
21
- "tailwindcss-safe-area-capacitor": "^0.5.1"
21
+ "tailwindcss-safe-area-capacitor": "^0.5.1",
22
+ "vidstack": "^1.12.13"
22
23
  },
23
24
  "peerDependencies": {
24
25
  "axios": "^1.12.2",
25
- "es-toolkit": "^1.40.0",
26
26
  "crypto-js": "4.2.0",
27
+ "es-toolkit": "^1.40.0",
27
28
  "motion-v": "1.7.3",
28
29
  "naive-ui": "2.43.1",
29
30
  "pinia": "^3.0.3",
@@ -41,7 +42,7 @@
41
42
  "lightningcss": "^1.30.2",
42
43
  "tailwindcss": "^4.1.14",
43
44
  "unplugin-vue-components": "30.0.0",
44
- "vite": "npm:rolldown-vite@^7.1.19",
45
+ "vite": "npm:rolldown-vite@^7.1.20",
45
46
  "vite-plugin-dts": "^4.5.4",
46
47
  "vue-component-type-helpers": "^3.1.1"
47
48
  },