wip: Adding in properties and nested path

This commit is contained in:
J H
2024-03-23 09:03:56 -06:00
parent 4a27128a1c
commit f5360cb8d4
13 changed files with 198 additions and 180 deletions

View File

@@ -0,0 +1,12 @@
import { Affine, _ } from "../util"
import { PathBuilder, extractJsonPath, pathBuilder } from "./PathBuilder"
export type ExposedStorePaths = string[] & Affine<"ExposedStorePaths">
export const setupExposeStore = <Store extends Record<string, any>>(
fn: (pathBuilder: PathBuilder<Store>) => PathBuilder<Store, any>[],
) => {
return fn(pathBuilder<Store>()).map(
(x) => extractJsonPath(x) as string,
) as ExposedStorePaths
}