@inlay/core 0.0.1

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,12 @@
1
+ import type { l } from "@atproto/lex";
2
+ type Node = {
3
+ type: l.NsidString;
4
+ props?: l.UnknownObject;
5
+ };
6
+ type LexiconModule = {
7
+ readonly $nsid: l.NsidString;
8
+ readonly main: l.Procedure;
9
+ };
10
+ export declare function $<M extends LexiconModule>(mod: M, props?: Omit<l.InferMethodInputBody<M["main"]>, "children">, children?: (Node | string | number | false | null | undefined)[]): Node;
11
+ export {};
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAGtC,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,CAAC,CAAC,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC;CACzB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,UAAU,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,wBAAgB,CAAC,CAAC,CAAC,SAAS,aAAa,EACvC,GAAG,EAAE,CAAC,EACN,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,EAC3D,QAAQ,CAAC,EAAE,CAAC,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,GAC/D,IAAI,CAMN"}
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ // Minimal helper to create nodes from generated lexicon modules
2
+ //
3
+ // Usage:
4
+ // import { Stack } from "@/generated/org/design";
5
+ // import { Post } from "@/generated/com/example";
6
+ // import { $ } from "@inlay/core";
7
+ //
8
+ // $(Stack, { gap: "medium" }, [
9
+ // $(Post, { uri: 'at://...' })
10
+ // ])
11
+ //
12
+ // Node types are NSIDs (e.g., "com.example.Post")
13
+ export function $(mod, props, children) {
14
+ const finalProps = children != null ? { ...props, children } : props;
15
+ return {
16
+ type: mod.$nsid,
17
+ props: finalProps,
18
+ };
19
+ }
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@inlay/core",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "author": "Dan Abramov <dan.abramov@gmail.com>",
6
+ "license": "MIT",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsc",
20
+ "dev": "tsc --watch",
21
+ "prepublishOnly": "npm run build"
22
+ },
23
+ "dependencies": {
24
+ "@atproto/lex": "^0.0.12"
25
+ },
26
+ "devDependencies": {
27
+ "typescript": "^5.9.0"
28
+ }
29
+ }