Skip to content

Commit

Permalink
temp: add docspace-sdk-js-resource to site
Browse files Browse the repository at this point in the history
  • Loading branch information
vanyauhalin committed Dec 4, 2024
1 parent 6f5de5f commit d5daaf3
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@onlyoffice/docspace-hosted-solutions-resource": "workspace:^",
"@onlyoffice/docspace-plugin-sdk-resource": "workspace:^",
"@onlyoffice/docspace-resource": "workspace:^",
"@onlyoffice/docspace-sdk-js-resource": "workspace:^",
"@onlyoffice/document-builder-hast-element": "workspace:^",
"@onlyoffice/document-builder-html-element": "workspace:^",
"@onlyoffice/document-builder-resource": "workspace:^",
Expand Down
7 changes: 7 additions & 0 deletions site/pages/DocSpace/JavaScript SDK/Test/g.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {type Data} from "@onlyoffice/eleventy-types"
import * as g from "@/generations/library-next.ts"
import {Resource} from "@/resources/docspace-sdk-js.ts"

export function data(): Data {
return g.data(Resource.shared)
}
Empty file.
31 changes: 31 additions & 0 deletions site/resources/docspace-sdk-js.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import {Resource as S} from "@onlyoffice/docspace-sdk-js-resource"
import {isBuild} from "@onlyoffice/eleventy-env"
import {Resource as F} from "@onlyoffice/fixture-resource/typedoc.ts"

export const Resource = r()

type T = typeof S | typeof F
type I = T["shared"]

function r(): T {
const T = t()
f(T.shared)
return T
}

function t(): T {
if (isBuild()) {
return S
}
return F
}

function f(r: I): void {
const e = r.retrieve(0)

if (e.type !== "declaration") {
throw new Error(`Root entity must be a declaration: ${e.type}`)
}

e.declaration.name = "SDK"
}

0 comments on commit d5daaf3

Please sign in to comment.