Skip to content

Commit 8ac1102

Browse files
committed
feat: 增加多个钩子和工具函数的导出
1 parent ea6698f commit 8ac1102

File tree

1 file changed

+109
-1
lines changed

1 file changed

+109
-1
lines changed

src/index.ts

Lines changed: 109 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,114 @@
1+
// Hooks exports
12
export { default as useEvent } from './hooks/useEvent';
3+
export { default as useEffect } from './hooks/useEffect';
4+
export { default as useId } from './hooks/useId';
5+
export { resetUuid } from './hooks/useId';
6+
export { default as useLayoutEffect } from './hooks/useLayoutEffect';
7+
export { useLayoutUpdateEffect } from './hooks/useLayoutEffect';
8+
export { default as useMemo } from './hooks/useMemo';
29
export { default as useMergedState } from './hooks/useMergedState';
3-
export { supportNodeRef, supportRef, useComposeRef } from './ref';
10+
export { default as useMobile } from './hooks/useMobile';
11+
export { default as useState } from './hooks/useState';
12+
export { default as useSyncState } from './hooks/useSyncState';
13+
14+
// Hook types
15+
export type { SetState } from './hooks/useState';
16+
export type { SetState as SyncSetState } from './hooks/useSyncState';
17+
18+
// Ref utilities
19+
export {
20+
supportNodeRef,
21+
supportRef,
22+
useComposeRef,
23+
fillRef,
24+
composeRef,
25+
getNodeRef,
26+
} from './ref';
27+
28+
// Utility functions
429
export { default as get } from './utils/get';
530
export { default as set } from './utils/set';
31+
export { merge } from './utils/set';
632
export { default as warning } from './warning';
33+
export { default as omit } from './omit';
34+
export { default as KeyCode } from './KeyCode';
35+
export { default as isEqual } from './isEqual';
36+
export { default as isMobile } from './isMobile';
37+
export { default as raf } from './raf';
38+
export { default as proxyObject } from './proxyObject';
39+
export { default as setStyle } from './setStyle';
40+
export { default as pickAttrs } from './pickAttrs';
41+
export { default as composeProps } from './composeProps';
42+
43+
// Warning utilities
44+
export {
45+
preMessage,
46+
warning as warningFunc,
47+
note,
48+
resetWarned,
49+
call,
50+
warningOnce,
51+
noteOnce,
52+
} from './warning';
53+
export type { preMessageFn } from './warning';
54+
55+
// Set utilities types
56+
export type { Path } from './utils/set';
57+
58+
// SetStyle types
59+
export type { SetStyleOptions } from './setStyle';
60+
61+
// PickAttrs types
62+
export type { PickConfig } from './pickAttrs';
63+
64+
// Children utilities
65+
export { default as toArray } from './Children/toArray';
66+
export type { Option as ToArrayOption } from './Children/toArray';
67+
68+
// DOM utilities
69+
export { default as canUseDom } from './Dom/canUseDom';
70+
export { default as contains } from './Dom/contains';
71+
export {
72+
injectCSS,
73+
removeCSS,
74+
clearContainerCache,
75+
updateCSS,
76+
} from './Dom/dynamicCSS';
77+
export { default as findDOMNode, isDOM, getDOM } from './Dom/findDOMNode';
78+
export {
79+
getFocusNodeList,
80+
saveLastFocusNode,
81+
clearLastFocusNode,
82+
backLastFocusNode,
83+
limitTabRange,
84+
} from './Dom/focus';
85+
export { default as isVisible } from './Dom/isVisible';
86+
export { default as ScrollLocker } from './Dom/scrollLocker';
87+
export { inShadow, getShadowRoot } from './Dom/shadow';
88+
export { isStyleSupport } from './Dom/styleChecker';
89+
90+
// DOM types
91+
export type { ContainerType, Prepend, AppendType } from './Dom/dynamicCSS';
92+
export type { scrollLockOptions } from './Dom/scrollLocker';
93+
94+
// React utilities
95+
export { default as isFragment } from './React/isFragment';
96+
export { render, unmount } from './React/render';
97+
98+
// Portal components
99+
export { default as Portal } from './Portal';
100+
export { default as PortalWrapper, getOpenCount } from './PortalWrapper';
101+
102+
// Portal types
103+
export type { PortalRef, PortalProps } from './Portal';
104+
export type { GetContainer, PortalWrapperProps } from './PortalWrapper';
105+
106+
// Scroll utilities
107+
export {
108+
default as getScrollBarSize,
109+
getTargetScrollBarSize,
110+
} from './getScrollBarSize';
111+
112+
// Test utilities
113+
export { spyElementPrototypes, spyElementPrototype } from './test/domHook';
114+
export type { ElementClass, Property } from './test/domHook';

0 commit comments

Comments
 (0)