@imagexmedia/typescript 0.0.1 → 0.0.3

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@imagexmedia/typescript",
3
3
  "type": "module",
4
- "version": "0.0.1",
4
+ "version": "0.0.3",
5
5
  "description": "The ImageX SWAT TypeScript package.",
6
6
  "author": "ImageX Media",
7
7
  "license": "MIT",
@@ -12,19 +12,22 @@
12
12
  "tsconfig.json",
13
13
  "types"
14
14
  ],
15
+ "engines": {
16
+ "node": ">=22"
17
+ },
15
18
  "scripts": {
16
19
  "build": "mkdir -p packs && npm pack --pack-destination packs"
17
20
  },
18
- "peerDependencies": {
21
+ "dependencies": {
19
22
  "@tsconfig/node-ts": "^23.6.2",
20
- "@tsconfig/node24": "^24.0.3",
23
+ "@tsconfig/node24": "^24.0.4",
21
24
  "@tsconfig/recommended": "^1.0.13",
22
- "@tsconfig/vite-react": "^3.4.0",
25
+ "@tsconfig/vite-react": "^7.0.2",
23
26
  "@types/jquery": "^3.5.33",
24
27
  "@types/jquery.form": "^3.26.35",
25
28
  "@types/jqueryui": "^1.12.24",
26
- "@types/node": "^24.10.2",
27
- "tabbable": "^6.3.0",
29
+ "@types/node": "^25.0.10",
30
+ "tabbable": "^6.4.0",
28
31
  "typescript": "^5.9.3"
29
32
  }
30
33
  }
@@ -1 +1,90 @@
1
1
  // @see https://git.drupalcode.org/project/drupal/-/blob/11.x/core/misc/ajax.js
2
+
3
+ declare global {
4
+ interface DrupalAjax {
5
+ AJAX_REQUEST_PARAMETER: string
6
+ prototype: { [key: string]: any } & DrupalAjaxInstance
7
+ }
8
+
9
+ interface DrupalAjaxSettings extends JQueryAjaxSettings {
10
+ base?: string
11
+ element?: HTMLElement
12
+ httpMethod?: string
13
+ event?: string | null
14
+ keypress?: boolean
15
+ selector?: string | null
16
+ effect?: string
17
+ speed?: string | number
18
+ method?: string
19
+ progress?: { type?: string, message?: string } | false
20
+ submit?: { js: boolean }
21
+ setClick?: boolean
22
+ dialogType?: string
23
+ dialog?: string
24
+ dialogRenderer?: string
25
+ }
26
+
27
+ interface DrupalAjaxFormOptions extends JQueryFormOptions {
28
+ isInProgress: () => boolean
29
+ extraData: any
30
+ }
31
+
32
+ interface DrupalAjaxFormValues {
33
+ name: string
34
+ required: boolean
35
+ type: string
36
+ value: any
37
+ }
38
+
39
+ interface DrupalAjaxInstance {
40
+ commands: any
41
+ instanceIndex: number | false
42
+ wrapper?: string
43
+ element: HTMLElement
44
+ preCommandsFocusedElementSelector: string | null
45
+ elementSettings: DrupalAjaxSettings
46
+ $form?: JQuery
47
+ url?: string
48
+ options: JQueryAjaxSettings
49
+ ajaxing?: boolean
50
+ execute: () => JQueryDeferred
51
+ keypressResponse: (element: HTMLElement, event: JQuery.Event) => void
52
+ eventResponse: (element: HTMLElement, event: JQuery.Event) => void
53
+ beforeSerialize: (element: JQuery, options: DrupalAjaxFormOptions) => void
54
+ beforeSubmit: (formValues: DrupalAjaxFormValues[], element: JQuery, options: DrupalAjaxFormOptions) => void
55
+ beforeSend: (xmlhttprequest: JQueryXHR, options: DrupalAjaxFormOptions) => void
56
+ setProgressIndicatorBar: () => void
57
+ setProgressIndicatorThrobber: () => void
58
+ setProgressIndicatorFullscreen: () => void
59
+ commandExecutionQueue: (response: any, status: number) => Promise
60
+ success: (response: DrupalAjaxCommand[], status: number) => Promise
61
+ settings: DrupalSettings
62
+ getEffect: <T extends { effect: string, speed: string | number }>(response: T) => T
63
+ error: (xmlhttprequest: JQueryXHR, uri: string, customMessage: string) => void
64
+ }
65
+
66
+ interface DrupalAjaxCommand {
67
+ command: string
68
+ method?: string
69
+ selector?: string
70
+ data?: string
71
+ settings?: DrupalSettings
72
+ }
73
+
74
+ interface Drupal {
75
+ ajax: ((settings: DrupalAjaxSettings) => DrupalAjaxInstance) & {
76
+ WRAPPER_FORMAT: string
77
+ instances: DrupalAjaxInstance[]
78
+ expired: () => DrupalAjaxInstance[]
79
+ bindAjaxLinks: (element: HTMLElement) => void
80
+ }
81
+ Ajax: (new (base: string, element: HTMLElement, elementSettings: DrupalAjaxSettings) => DrupalAjaxInstance) & DrupalAjax
82
+ AjaxCommands: {
83
+ prototype: {
84
+ [key: string]: (ajax: DrupalAjaxInstance, response: any, status?: number) => any
85
+ }
86
+ }
87
+ }
88
+ }
89
+
90
+ export type {}
@@ -12,7 +12,7 @@ declare global {
12
12
  interface DrupalLocaleOptions { context?: string }
13
13
 
14
14
  interface DrupalTheme {
15
- [key: string]: (...args: any[]) => string
15
+ [key: string]: (...args: any[]) => any
16
16
  placeholder: (value: string) => string
17
17
  }
18
18
 
@@ -0,0 +1,32 @@
1
+ // @see https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/views/js/ajax_view.js
2
+
3
+ declare global {
4
+ interface DrupalViewsAjaxSettings {
5
+ view_name: string
6
+ view_display_id: string
7
+ view_args: string
8
+ view_path: string
9
+ view_base_path: string | null
10
+ view_dom_id: string
11
+ pager_element: number
12
+ }
13
+
14
+ interface Drupal {
15
+ views: {
16
+ instances: {
17
+ [key: string]: {
18
+ $exposed_form: JQuery
19
+ $view: JQuery
20
+ element_settings: DrupalAjaxSettings
21
+ exposedFormAjax: DrupalAjaxInstance[]
22
+ pagerAjax: DrupalAjaxInstance
23
+ refreshViewAjax: DrupalAjaxInstance
24
+ settings: DrupalViewsAjaxSettings
25
+ }
26
+ }
27
+ ajaxView: (settings: DrupalViewsAjaxSettings) => void
28
+ }
29
+ }
30
+ }
31
+
32
+ export type {}
@@ -1,6 +1,6 @@
1
1
  // @see https://git.drupalcode.org/project/drupal/-/blob/11.x/core/misc/tabbingmanager.js
2
2
 
3
- import type { tabbable as tabbableType } from 'tabbable'
3
+ import type { focusable, isFocusable, isTabbable, tabbable } from 'tabbable'
4
4
 
5
5
  type TabbingSelector = HTMLElement | HTMLElement[] | JQuery | Selection | string
6
6
 
@@ -29,10 +29,13 @@ declare global {
29
29
  }
30
30
  }
31
31
 
32
- const tabbable: typeof tabbableType
33
-
34
32
  interface Window {
35
- tabbable: typeof tabbableType
33
+ tabbable: {
34
+ tabbable: typeof tabbable
35
+ focusable: typeof focusable
36
+ isFocusable: typeof isFocusable
37
+ isTabbable: typeof isTabbable
38
+ }
36
39
  }
37
40
  }
38
41