Skip to content

Commit

Permalink
feat(core/dom): export a selector
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaodong2008 committed Jun 28, 2024
1 parent 97e16e4 commit d0ee24d
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions packages/core/src/dom/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
import selector from "./selector";
import { createFastjsDom } from "./dom";
import { createFastjsDomList } from "./dom-list";
import type { FastjsDom } from "./dom-types";
import type { FastjsDomList } from "./dom-list-types";

export default {
select: selector,
newEl: createFastjsDom,
newElList: createFastjsDomList
const dom = function <
T extends FastjsDom | FastjsDomList | null = FastjsDom | FastjsDomList | null
>(
target: string = "body",
parent: Document | HTMLElement | HTMLElement[] = document
): T {
return selector(target, parent);
};
dom.select = selector;
dom.newEl = createFastjsDom;
dom.newElList = createFastjsDomList;

export default dom;

export type * from "./def";
export type * from "./dom-types";
Expand Down

0 comments on commit d0ee24d

Please sign in to comment.