@carats/render 0.0.6 → 0.0.7
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.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ interface PageComponentResult {
|
|
|
19
19
|
params: Record<string, string>;
|
|
20
20
|
route: string;
|
|
21
21
|
}
|
|
22
|
-
declare function getPageComponent(this: Facets,
|
|
22
|
+
declare function getPageComponent(this: Facets, url: string): PageComponentResult;
|
|
23
23
|
declare function renderPage<T = any>(this: Facets, component: CaratsComponent<T>, props: T): Promise<string>;
|
|
24
24
|
declare function Burnish<T = any>(component: CaratsComponent<T>): CaratsComponent<T>;
|
|
25
25
|
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{matchRoute as
|
|
1
|
+
import{matchRoute as u}from"@carats/url";import{transpile as i}from"jjsx";function l(e){let{routes:t,suspense:o}=this,m=new URL(e,"http://localhost").pathname;for(let n in t){let r=t[n],s=u(n,m);if(s)return r instanceof Promise?{component:()=>{let a=`carats-suspense-${n}`;return r.then(p=>{document.getElementById(a)?.replaceWith(i(p))}).catch(p=>{document.getElementById(a)?.replaceWith(i(o.error(p)))}),JJSX.jsxFactory("div",{id:a},o.loading())},params:s,route:n}:{component:r,params:s,route:n}}return{component:o.notFound,params:{},route:"/not-found"}}async function C(e,t){return i(e(t))}function g(e){return e.burnished=!0,e}export{g as Burnish,l as getPageComponent,C as renderPage};
|