@popclip/types 1.4624.1 → 1.4624.2

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 (2) hide show
  1. package/package.json +1 -1
  2. package/popclip.d.ts +8 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popclip/types",
3
- "version": "1.4624.1",
3
+ "version": "1.4624.2",
4
4
  "devDependencies": {
5
5
  "typedoc": "0.25.13",
6
6
  "typescript": "5.4.5"
package/popclip.d.ts CHANGED
@@ -604,9 +604,8 @@ type Option =
604
604
 
605
605
  // Create a type mapping from Option Type to TypeScript types
606
606
  type OptionTypeMapping = {
607
- secret: string;
608
- password: string;
609
607
  string: string;
608
+ secret: string;
610
609
  multiple: string;
611
610
  boolean: boolean;
612
611
  };
@@ -616,12 +615,17 @@ type ExtractType<T extends Option> = T["type"] extends keyof OptionTypeMapping
616
615
  ? OptionTypeMapping[T["type"]]
617
616
  : never;
618
617
 
618
+ // Helper type to exclude `never` properties
619
+ type ExcludeNever<T> = {
620
+ [K in keyof T as T[K] extends never ? never : K]: T[K];
621
+ };
622
+
619
623
  // Create a utility type to infer the OmnivoreOptions type
620
- type InferOptions<T extends readonly Option[]> = {
624
+ type InferOptions<T extends readonly Option[]> = ExcludeNever<{
621
625
  readonly [K in T[number]["identifier"]]: ExtractType<
622
626
  Extract<T[number], { identifier: K }>
623
627
  >;
624
- } & AuthOptions;
628
+ }>;
625
629
 
626
630
  /**
627
631
  * Represents a generic range, as a location and length