astro-altcha 0.1.0 → 0.1.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.
@@ -27,6 +27,23 @@ function integration(options = {}) {
27
27
  });
28
28
  },
29
29
  "astro:config:done": ({ injectTypes }) => {
30
+ injectTypes({
31
+ filename: "types.d.ts",
32
+ content: `declare module "astro-altcha:config" {
33
+ export const config: Required<
34
+ import("astro-altcha/types").ResolvedAstroAltchaConfig<
35
+ import("astro-altcha/types").Algorithm
36
+ >
37
+ >;
38
+ }
39
+
40
+ declare namespace App {
41
+ interface Locals {
42
+ altcha: import("astro-altcha/types/altcha").VerifySolutionResult | import("astro-altcha/types/altcha-lib").VerifyServerResult | null;
43
+ }
44
+ }
45
+ `
46
+ });
30
47
  injectTypes({
31
48
  filename: "astro-altcha-events.d.ts",
32
49
  content: `import type { WidgetAttributes, WidgetMethods } from "astro-altcha/types/altcha"
@@ -51,15 +68,6 @@ declare global {
51
68
  };
52
69
 
53
70
  export {};
54
- `
55
- });
56
- injectTypes({
57
- filename: "astro-altcha-locals.d.ts",
58
- content: `declare namespace App {
59
- interface Locals {
60
- altcha: import("astro-altcha/types/altcha").VerifySolutionResult | import("astro-altcha/types/altcha-lib").VerifyServerResult | null;
61
- }
62
- }
63
71
  `
64
72
  });
65
73
  }
@@ -3,7 +3,7 @@ import { WidgetAttributes } from "altcha/types";
3
3
  //#region src/types/index.d.ts
4
4
  export type AltchaWidgetName = `${string}astro-altcha${string}`;
5
5
  export type Algorithm = `PBKDF2/${Digest}` | "Argon2id" | "Scrypt" | Digest;
6
- type Digest = `SHA-${"256" | "384" | 512}`;
6
+ type Digest = `SHA-${"256" | "384" | "512"}`;
7
7
  export type AstroAltchaConfig = {
8
8
  /**
9
9
  * Default altcha-widget name. Must contain the string `astro-altcha`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-altcha",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Altcha integration for Astro",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -9,16 +9,20 @@
9
9
  "types": "./dist/index.d.ts",
10
10
  "default": "./dist/index.js"
11
11
  },
12
+ "./package.json": "./package.json",
12
13
  "./types": {
13
- "types": "./dist/types.d.ts"
14
+ "types": "./dist/types/index.d.ts",
15
+ "default": "./dist/types/index.js"
14
16
  },
15
17
  "./types/altcha": {
16
- "types": "./dist/types/altcha.d.ts"
18
+ "types": "./dist/types/altcha.d.ts",
19
+ "default": "./dist/types/altcha.js"
17
20
  },
18
21
  "./types/altcha-lib": {
19
- "types": "./dist/types/altcha-lib.d.ts"
22
+ "types": "./dist/types/altcha-lib.d.ts",
23
+ "default": "./dist/types/altcha-lib.js"
20
24
  },
21
- "./components": "./src/components/index.ts",
25
+ "./components": "./src/components/index.js",
22
26
  "./components/*": "./src/components/*"
23
27
  },
24
28
  "files": [
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  import { config } from "astro-altcha:config";
3
- import type { AltchaFormProps } from "../types/index.js";
3
+ import type { AltchaFormProps } from "astro-altcha/types";
4
4
 
5
5
  type Props = AltchaFormProps;
6
6
 
@@ -1,5 +1,5 @@
1
1
  import type { WidgetAttributes, WidgetMethods } from "altcha/types";
2
- import type { AstroAltchaHydrationStrategy } from "../types/index.js";
2
+ import type { AstroAltchaHydrationStrategy } from "astro-altcha/types";
3
3
 
4
4
  const altchaWidgets = document.querySelectorAll("altcha-widget");
5
5