@delta-comic/plugin 0.1.0 → 0.2.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.
@@ -1,10 +1,12 @@
1
1
  import { Component, Raw } from 'vue';
2
2
  import { default as Inject } from './Inject.vue';
3
+ import { ComponentProps } from 'vue-component-type-helpers';
4
+ export { Inject };
3
5
  export type GlobalInjectionsConfig<T extends keyof GlobalInjections = keyof GlobalInjections> = {
4
6
  key: T;
5
7
  component: Raw<GlobalInjections[T]>;
8
+ condition: (args: ComponentProps<GlobalInjections[T]>) => boolean | Promise<boolean>;
6
9
  };
7
10
  export interface GlobalInjections extends Record<string, Component> {
8
11
  }
9
- export declare const addInjection: <T extends keyof GlobalInjections>(key: T, value: GlobalInjections[T]) => void;
10
- export { Inject };
12
+ export declare const addInjection: <T extends keyof GlobalInjections, TCfg extends GlobalInjectionsConfig<T> = GlobalInjectionsConfig<T>>(key: TCfg["key"], value: TCfg["component"], condition?: TCfg["condition"]) => void;
package/dist/pack.tgz CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delta-comic/plugin",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "空阙虱楼",
5
5
  "homepage": "https://github.com/delta-comic/delta-comic-core",
6
6
  "license": "AGPL-3.0-only",