solid-alive 0.0.8 → 0.1.0

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.
@@ -0,0 +1,50 @@
1
+ import { JSX } from 'solid-js'
2
+
3
+ declare module 'solid-js' {
4
+ namespace JSX {
5
+ interface Directives {
6
+ directiveSaveScroll: ((dom: Element) => void) | boolean
7
+ }
8
+ }
9
+ }
10
+
11
+ export interface pub {
12
+ scrollId?: string // 保存
13
+ behavior?: 'alwaysTop' | 'saveScroll'
14
+ transitionEnterName?: 'appear' |'toLeft'
15
+ }
16
+
17
+ export interface ProveiderProps extends pub {
18
+ children: JSX.Element
19
+ }
20
+
21
+ export interface NodeInfo {
22
+ id: string
23
+ component: JSX.Element
24
+ owner: Owner | null
25
+ scroll: {top:number,left:number} | null
26
+ domList: Map<Element, {top:number,left:number }> | null
27
+ children?: Array<string> | null
28
+ selfDom?:Element
29
+ dispose: (() => void) | null
30
+ onActivated: null | (() => void)
31
+ onDeactivated: null | (() => void)
32
+ }
33
+
34
+ export interface StoreProps {
35
+ [propsName: string]: NodeInfo
36
+ }
37
+
38
+ export interface ContextProps extends pub {
39
+ elements: StoreProps
40
+ closeSymbol: symbol
41
+ insertElement: (d: NodeInfo) => void
42
+ onActivated: (cb: () => void) => void
43
+ onDeactivated: (cb: () => void) => void
44
+ removeAliveElement: (id?: string) => void
45
+ saveScroll: (id: string, s:{top:number,left:number}) => void
46
+ setCurrentComponentId: (id: string | symbol) => void
47
+ saveElScroll: (dom: Element) => void // 用来 保存 某一个dom, 暂时用来保存scroll
48
+ resetElScroll: (dom: Element) => boolean // 重置高度, 变成0
49
+ removeScrollEl: (dom: Element) => boolean // 删除 保存的 滚动条 元素
50
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solid-alive",
3
- "version": "0.0.8",
3
+ "version": "0.1.0",
4
4
  "description": "solid-alive",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
File without changes