delta-comic-core 0.0.5 → 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.
@@ -44,21 +44,26 @@ export declare const useConfig: import('pinia').StoreDefinition<"config", Pick<{
44
44
  form: ConfigDescription;
45
45
  value: Ref<any>;
46
46
  }>>;
47
- $load: <T extends ConfigPointer>(pointer: T) => { [K in keyof T["config"]]: UniFormResult<T["config"][K]>; };
47
+ $load: <T extends ConfigPointer>(pointer: T) => Ref<{ [K in keyof T["config"]]: UniFormResult<T["config"][K]>; }>;
48
+ $isExistConfig: (pointer: ConfigPointer) => boolean;
49
+ $resignerConfig: (pointer: ConfigPointer) => void;
48
50
  }, "form">, Pick<{
49
51
  isDark: import('vue').ComputedRef<boolean>;
50
52
  form: import('vue').ShallowReactive<Map<symbol, {
51
53
  form: ConfigDescription;
52
54
  value: Ref<any>;
53
55
  }>>;
54
- $load: <T extends ConfigPointer>(pointer: T) => { [K in keyof T["config"]]: UniFormResult<T["config"][K]>; };
56
+ $load: <T extends ConfigPointer>(pointer: T) => Ref<{ [K in keyof T["config"]]: UniFormResult<T["config"][K]>; }>;
57
+ $isExistConfig: (pointer: ConfigPointer) => boolean;
58
+ $resignerConfig: (pointer: ConfigPointer) => void;
55
59
  }, "isDark">, Pick<{
56
60
  isDark: import('vue').ComputedRef<boolean>;
57
61
  form: import('vue').ShallowReactive<Map<symbol, {
58
62
  form: ConfigDescription;
59
63
  value: Ref<any>;
60
64
  }>>;
61
- $load: <T extends ConfigPointer>(pointer: T) => { [K in keyof T["config"]]: UniFormResult<T["config"][K]>; };
62
- }, "$load">>;
63
- export declare const resignerConfig: (pointer: ConfigPointer) => void;
65
+ $load: <T extends ConfigPointer>(pointer: T) => Ref<{ [K in keyof T["config"]]: UniFormResult<T["config"][K]>; }>;
66
+ $isExistConfig: (pointer: ConfigPointer) => boolean;
67
+ $resignerConfig: (pointer: ConfigPointer) => void;
68
+ }, "$load" | "$isExistConfig" | "$resignerConfig">>;
64
69
  export {};
package/dist/index.d.ts CHANGED
@@ -2252,22 +2252,28 @@ export declare const Store: {
2252
2252
  form: import('./config').ConfigDescription;
2253
2253
  value: import('vue').Ref<any>;
2254
2254
  }>>;
2255
- $load: <T extends ConfigPointer>(pointer: T) => { [K in keyof T["config"]]: import('./index.ts').UniFormResult<T["config"][K]>; };
2255
+ $load: <T extends ConfigPointer>(pointer: T) => import('vue').Ref<{ [K in keyof T["config"]]: import('./index.ts').UniFormResult<T["config"][K]>; }>;
2256
+ $isExistConfig: (pointer: ConfigPointer) => boolean;
2257
+ $resignerConfig: (pointer: ConfigPointer) => void;
2256
2258
  }, "form">, Pick<{
2257
2259
  isDark: import('vue').ComputedRef<boolean>;
2258
2260
  form: import('vue').ShallowReactive<Map<symbol, {
2259
2261
  form: import('./config').ConfigDescription;
2260
2262
  value: import('vue').Ref<any>;
2261
2263
  }>>;
2262
- $load: <T extends ConfigPointer>(pointer: T) => { [K in keyof T["config"]]: import('./index.ts').UniFormResult<T["config"][K]>; };
2264
+ $load: <T extends ConfigPointer>(pointer: T) => import('vue').Ref<{ [K in keyof T["config"]]: import('./index.ts').UniFormResult<T["config"][K]>; }>;
2265
+ $isExistConfig: (pointer: ConfigPointer) => boolean;
2266
+ $resignerConfig: (pointer: ConfigPointer) => void;
2263
2267
  }, "isDark">, Pick<{
2264
2268
  isDark: import('vue').ComputedRef<boolean>;
2265
2269
  form: import('vue').ShallowReactive<Map<symbol, {
2266
2270
  form: import('./config').ConfigDescription;
2267
2271
  value: import('vue').Ref<any>;
2268
2272
  }>>;
2269
- $load: <T extends ConfigPointer>(pointer: T) => { [K in keyof T["config"]]: import('./index.ts').UniFormResult<T["config"][K]>; };
2270
- }, "$load">>;
2273
+ $load: <T extends ConfigPointer>(pointer: T) => import('vue').Ref<{ [K in keyof T["config"]]: import('./index.ts').UniFormResult<T["config"][K]>; }>;
2274
+ $isExistConfig: (pointer: ConfigPointer) => boolean;
2275
+ $resignerConfig: (pointer: ConfigPointer) => void;
2276
+ }, "$load" | "$isExistConfig" | "$resignerConfig">>;
2271
2277
  appConfig: ConfigPointer<{
2272
2278
  recordHistory: {
2273
2279
  type: "switch";
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;
@@ -33,6 +45,7 @@ export interface RawItem {
33
45
  description?: string;
34
46
  thisEp: RawEp;
35
47
  commentSendable: boolean;
48
+ customIsSafe?: boolean;
36
49
  }
37
50
  export declare abstract class Item extends Struct<RawItem> implements RawItem {
38
51
  abstract like(signal?: AbortSignal): PromiseLike<boolean>;
@@ -44,7 +57,7 @@ export declare abstract class Item extends Struct<RawItem> implements RawItem {
44
57
  title: string;
45
58
  id: string;
46
59
  categories: Category[];
47
- author: string[];
60
+ author: Author[];
48
61
  viewNumber?: number;
49
62
  likeNumber?: number;
50
63
  commentNumber?: number;
@@ -58,6 +71,7 @@ export declare abstract class Item extends Struct<RawItem> implements RawItem {
58
71
  $$plugin: string;
59
72
  $$meta: MetaData;
60
73
  thisEp: RawEp;
74
+ customIsSafe?: boolean;
61
75
  get $thisEp(): Ep;
62
76
  constructor(v: RawItem);
63
77
  commentSendable: boolean;
@@ -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.5",
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
  },