delta-comic-core 0.3.2 → 0.3.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.
@@ -6,6 +6,7 @@ import { RStream, RPromiseContent } from '../utils/data';
6
6
  import { Item, RawItem, Author, ItemCardComp } from '../struct/item';
7
7
  import { Component, MaybeRefOrGetter } from 'vue';
8
8
  import { ConfigPointer } from '../config';
9
+ import { SharedFunctions } from '../utils/eventBus';
9
10
  export type PluginDefineResult = {
10
11
  api?: Record<string, string | undefined | false>;
11
12
  };
@@ -125,6 +126,15 @@ export interface PluginConfigSearch {
125
126
  topButton?: PluginConfigSearchHotPageTopButton[];
126
127
  mainListCard?: PluginConfigSearchHotPageMainList[];
127
128
  };
129
+ barcode?: PluginConfigSearchBarcode[];
130
+ }
131
+ export interface PluginConfigSearchBarcode {
132
+ match: (searchText: string) => boolean;
133
+ /**
134
+ * 选中后返回路由信息
135
+ */
136
+ getContent: (searchText: string, signal: AbortSignal) => PromiseLike<Parameters<SharedFunctions['routeToContent']>>;
137
+ name: string;
128
138
  }
129
139
  export interface PluginConfigSearchHotPageLevelboard {
130
140
  name: string;
@@ -3,7 +3,11 @@ export declare const definePlugin: (config: PluginConfig | ((safe: boolean) => P
3
3
  fn: import('../utils/eventBus').SharedFunctions[keyof import('../utils/eventBus').SharedFunctions];
4
4
  plugin: string;
5
5
  result: void;
6
- }[] | undefined;
6
+ }[] & Promise<{
7
+ result: void;
8
+ fn: import('../utils/eventBus').SharedFunctions[keyof import('../utils/eventBus').SharedFunctions];
9
+ plugin: string;
10
+ }[]>;
7
11
  export interface RawPluginMeta {
8
12
  'name:display': string;
9
13
  'name:id': string;
@@ -2,7 +2,7 @@ import { Component } from 'vue';
2
2
  import { SourcedKeyMap, RStream, SourcedKeyType } from '../utils/data';
3
3
  import { uni } from '.';
4
4
  import { AudioSrc, MediaSrc, TextTrackInit } from 'vidstack';
5
- import { PluginConfigSearchCategory, PluginConfigSearchHotPageLevelboard, PluginConfigSearchHotPageMainList, PluginConfigSearchHotPageTopButton, PluginConfigSearchTabbar, PluginShareInitiativeItem, PluginShareToken } from '../plugin/define';
5
+ import { PluginConfigSearchBarcode, PluginConfigSearchCategory, PluginConfigSearchHotPageLevelboard, PluginConfigSearchHotPageMainList, PluginConfigSearchHotPageTopButton, PluginConfigSearchTabbar, PluginShareInitiativeItem, PluginShareToken } from '../plugin/define';
6
6
  import * as item from './item';
7
7
  import * as ep from './ep';
8
8
  import * as comment from './comment';
@@ -28,6 +28,8 @@ export declare abstract class ContentPage<T extends object = any> {
28
28
  static categories: import('vue').ShallowReactive<Map<string, PluginConfigSearchCategory[]>>;
29
29
  static addCategories(plugin: string, ...categories: PluginConfigSearchCategory[]): void;
30
30
  static contentPage: import('vue').ShallowReactive<SourcedKeyMap<[plugin: string, name: string], uni.content.ContentPageLike>>;
31
+ static barcode: import('vue').ShallowReactive<Map<string, PluginConfigSearchBarcode[]>>;
32
+ static addBarcode(plugin: string, cfg: PluginConfigSearchBarcode): string;
31
33
  static levelboard: import('vue').ShallowReactive<Map<string, PluginConfigSearchHotPageLevelboard[]>>;
32
34
  static addLevelboard(plugin: string, cfg: PluginConfigSearchHotPageLevelboard): string;
33
35
  static topButton: import('vue').ShallowReactive<Map<string, PluginConfigSearchHotPageTopButton[]>>;
@@ -8,7 +8,7 @@ export type EventBus = {
8
8
  };
9
9
  export declare const eventBus: import('mitt').Emitter<EventBus>;
10
10
  export type SharedFunctions = {
11
- getRandomProvide(signal: AbortSignal): PromiseLike<uni.item.Item[]>;
11
+ getRandomProvide(signal?: AbortSignal): PromiseLike<uni.item.Item[]>;
12
12
  addPlugin(ins: PluginConfig): void;
13
13
  addRecent(item: uni.item.Item): PromiseLike<any>;
14
14
  routeToContent(contentType_: uni.content.ContentType_, id: string, ep: string, preload?: uni.content.PreloadValue): PromiseLike<any>;
@@ -27,15 +27,27 @@ export declare class SharedFunction {
27
27
  fn: SharedFunctions[keyof SharedFunctions];
28
28
  plugin: string;
29
29
  result: ReturnType<SharedFunctions[TKey]>;
30
- }[] | undefined;
30
+ }[] & Promise<{
31
+ result: Awaited<ReturnType<SharedFunctions[TKey]>>;
32
+ fn: SharedFunctions[keyof SharedFunctions];
33
+ plugin: string;
34
+ }[]>;
31
35
  static callRandom<TKey extends keyof SharedFunctions>(name: TKey, ...args: Parameters<SharedFunctions[TKey]>): {
32
36
  fn: SharedFunctions[keyof SharedFunctions];
33
37
  plugin: string;
34
38
  result: ReturnType<SharedFunctions[TKey]>;
35
- };
39
+ } & Promise<{
40
+ result: Awaited<ReturnType<SharedFunctions[TKey]>>;
41
+ fn: SharedFunctions[keyof SharedFunctions];
42
+ plugin: string;
43
+ }>;
36
44
  static callWitch<TKey extends keyof SharedFunctions>(name: TKey, plugin: string, ...args: Parameters<SharedFunctions[TKey]>): {
37
45
  fn: SharedFunctions[keyof SharedFunctions];
38
46
  plugin: string;
39
47
  result: ReturnType<SharedFunctions[TKey]>;
40
- };
48
+ }[] & Promise<{
49
+ result: Awaited<ReturnType<SharedFunctions[TKey]>>;
50
+ fn: SharedFunctions[keyof SharedFunctions];
51
+ plugin: string;
52
+ }[]>;
41
53
  }
package/dist/pack.tgz CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "delta-comic-core",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "我曾亲眼见证神的熟视无睹.",
5
5
  "homepage": "https://github.com/wenxig/delta-comic-core",
6
6
  "repository": {