@zag-js/dom-query
Advanced tools
Comparing version 0.0.0-dev-20221103102301 to 0.0.0-dev-20221228121448
@@ -1,33 +0,3 @@ | ||
declare type Target = HTMLElement | EventTarget; | ||
declare function contains(parent: Target | null | undefined, child: Target | null): boolean; | ||
declare function isDocument(value: any): value is Document; | ||
declare function isWindow(value: any): value is Window; | ||
declare function isHTMLElement(value: any): value is HTMLElement; | ||
declare type BaseContext = { | ||
getRootNode?: () => Document | ShadowRoot | Node; | ||
}; | ||
declare type BaseDetails = { | ||
[event: string]: { | ||
[key: string]: any; | ||
}; | ||
}; | ||
interface CustomEventListener<EventMap extends BaseDetails> { | ||
<E extends keyof EventMap>(event: E, cb: (evt: CustomEvent<EventMap[E]>) => void): VoidFunction; | ||
} | ||
interface CustomEventEmitter<EventMap extends BaseDetails> { | ||
<E extends keyof EventMap>(evt: E, detail: EventMap[E], options?: EventInit): void; | ||
} | ||
declare type Callable<T> = T | (() => T); | ||
declare function defineHelpers<T>(rest: T): { | ||
getRootNode(ctx: BaseContext): Document | ShadowRoot; | ||
getDoc(ctx: BaseContext): Document; | ||
getWin(ctx: BaseContext): Window & typeof globalThis; | ||
getActiveElement(ctx: BaseContext): HTMLElement | null; | ||
getById<T_1 = HTMLElement>(ctx: BaseContext, id: string): T_1 | null; | ||
createEmitter<EventMap extends BaseDetails>(ctx: BaseContext, target: Callable<HTMLElement>): CustomEventEmitter<EventMap>; | ||
createListener<EventMap_1 extends BaseDetails>(target: Callable<HTMLElement>): CustomEventListener<EventMap_1>; | ||
} & T; | ||
export { CustomEventEmitter, CustomEventListener, contains, defineHelpers, isDocument, isHTMLElement, isWindow }; | ||
export { contains } from './contains.js'; | ||
export { isDocument, isHTMLElement, isWindow } from './is-element.js'; | ||
export { CustomEventEmitter, CustomEventListener, defineHelpers } from './helpers.js'; |
{ | ||
"name": "@zag-js/dom-query", | ||
"version": "0.0.0-dev-20221103102301", | ||
"version": "0.0.0-dev-20221228121448", | ||
"description": "The dom helper library for zag.js machines", | ||
@@ -14,5 +14,2 @@ "keywords": [ | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
"repository": "https://github.com/chakra-ui/zag/tree/main/packages/utilities/dom-helpers", | ||
@@ -29,6 +26,21 @@ "sideEffects": false, | ||
}, | ||
"clean-package": "../../../clean-package.config.json", | ||
"main": "dist/index.js", | ||
"devDependencies": { | ||
"clean-package": "2.2.0" | ||
}, | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.js" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"scripts": { | ||
"build-fast": "tsup src/index.ts --format=esm,cjs", | ||
"build-fast": "tsup src", | ||
"start": "pnpm build --watch", | ||
"build": "tsup src/index.ts --format=esm,cjs --dts", | ||
"build": "tsup src --dts", | ||
"test": "jest --config ../../../jest.config.js --rootDir . --passWithNoTests", | ||
@@ -35,0 +47,0 @@ "lint": "eslint src --ext .ts,.tsx", |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
19734
22
535
1
1