@devwareng/vanilla-ts 1.0.2 → 1.0.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +73 -1
  2. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -1,2 +1,74 @@
1
+ import { Config } from "dompurify";
1
2
 
2
- export { }
3
+ type TSCollection = (collections: string[], DOM: HTMLElement, elements: Function[], params?: any) => void;
4
+ type TSInitialDOM = (id: string, mount: (el: HTMLElement) => void) => void;
5
+ type TSVerify = (DOM: HTMLElement | void, authUrl: string, loginUrl: string) => string | null;
6
+ type TSAuth = (Component: HTMLElement | void, loginUrl: string) => HTMLElement | null;
7
+ type FetchFunction<T> = () => Promise<T>;
8
+ type FetchResult<T> = {
9
+ data: T | null;
10
+ isLoading: boolean;
11
+ error: Error | null;
12
+ }
13
+ type SanitizeInput = (input: string) => string;
14
+ type AnchorSingle = (
15
+ element: HTMLElement,
16
+ href: string,
17
+ ariaLabel: string,
18
+ className?: string,
19
+ childElement?: HTMLElement | null
20
+ ) => void;
21
+
22
+ type TSURLState = () => Record<string, string>;
23
+
24
+ type TSComponent = (
25
+ id: string,
26
+ DOM: HTMLElement,
27
+ element: Function,
28
+ params?: any,
29
+ params2?: any
30
+ ) => void;
31
+
32
+ type TSEvent = (
33
+ id: string,
34
+ eventType: keyof HTMLElementEventMap,
35
+ handler: (event: HTMLElementEventMap[keyof HTMLElementEventMap]) => void
36
+ ) => void;
37
+
38
+ type TSSelect = <T extends Element = HTMLElement>(selector: string) => T | null;
39
+ type TSPurifier = (input: string | HTMLElement, config?: Config) => string;
40
+
41
+ type SEOConfig = {
42
+ name?: string;
43
+ description?: string;
44
+ author?: string;
45
+ }
46
+
47
+ type CSPConfig = {
48
+ scriptSrc?: string;
49
+ styleSrc?: string;
50
+ objectSrc?: string;
51
+ connectSrc?: string[];
52
+ reportOnly?: boolean;
53
+ }
54
+
55
+ type SEOHandler = {
56
+ setName: (name: string) => void;
57
+ setDescription: (description: string) => void;
58
+ setAuthor: (author: string) => void;
59
+ getName: () => string;
60
+ getDescription: () => string;
61
+ getAuthor: () => string;
62
+ getAllMetaData: () => SEOConfig;
63
+ appendMetaTagsToHead: () => void;
64
+ }
65
+
66
+ type InputElementType = "input" | "select" | "textarea" | "form";
67
+
68
+ type TSInput = (id: string, elementType: InputElementType, form?: HTMLFormElement) => string;
69
+
70
+ type TSElementEach = (
71
+ elements: NodeListOf<HTMLElement> | HTMLElement[],
72
+ events: (keyof HTMLElementEventMap)[],
73
+ callback: (element: HTMLElement, event: Event) => void
74
+ ) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devwareng/vanilla-ts",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Framework-less TypeScript hooks for SPA development.",
5
5
  "author": "Waren Arapoc Gador",
6
6
  "license": "MIT",
@@ -42,4 +42,4 @@
42
42
  "@types/lodash": "^4.17.20",
43
43
  "tsup": "^8.5.0"
44
44
  }
45
- }
45
+ }