1 line
5.6 KiB
JavaScript
1 line
5.6 KiB
JavaScript
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([["8160"],{7063:function(e,n,r){r.r(n),r.d(n,{default:()=>h,frontMatter:()=>o,metadata:()=>s,assets:()=>c,toc:()=>a,contentTitle:()=>t});var s=JSON.parse('{"id":"api/functions/createPlayground","title":"Function: createPlayground()","description":"createPlayground(container, options)","source":"@site/docs/api/functions/createPlayground.md","sourceDirName":"api/functions","slug":"/api/functions/createPlayground","permalink":"/docs/api/functions/createPlayground","draft":false,"unlisted":false,"editUrl":"https://github.com/live-codes/livecodes/tree/develop/docs/docs/api/functions/createPlayground.md","tags":[],"version":"current","frontMatter":{}}'),i=r("5893"),d=r("65");let o={},t="Function: createPlayground()",c={},a=[{value:"createPlayground(container, options)",id:"createplaygroundcontainer-options",level:2},{value:"Parameters",id:"parameters",level:3},{value:"Returns",id:"returns",level:3},{value:"Defined in",id:"defined-in",level:3},{value:"createPlayground(options)",id:"createplaygroundoptions",level:2},{value:"Parameters",id:"parameters-1",level:3},{value:"Returns",id:"returns-1",level:3},{value:"Defined in",id:"defined-in-1",level:3}];function l(e){let n={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",strong:"strong",ul:"ul",...(0,d.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"function-createplayground",children:"Function: createPlayground()"})}),"\n",(0,i.jsx)(n.h2,{id:"createplaygroundcontainer-options",children:"createPlayground(container, options)"}),"\n",(0,i.jsxs)(n.blockquote,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"createPlayground"}),"(",(0,i.jsx)(n.code,{children:"container"}),", ",(0,i.jsx)(n.code,{children:"options"}),"?): ",(0,i.jsx)(n.code,{children:"Promise"}),"<",(0,i.jsx)(n.a,{href:"/docs/api/interfaces/Playground",children:(0,i.jsx)(n.code,{children:"Playground"})}),">"]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"Creates a LiveCodes playground."}),"\n",(0,i.jsx)(n.h3,{id:"parameters",children:"Parameters"}),"\n",(0,i.jsxs)(n.p,{children:["\u2022 ",(0,i.jsx)(n.strong,{children:"container"}),": ",(0,i.jsx)(n.code,{children:"string"})," | ",(0,i.jsx)(n.code,{children:"HTMLElement"})]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"HTMLElement"})," or a string representing a CSS selector. This is the container where the playground is rendered.\nIf not found, an error is thrown (except in ",(0,i.jsx)(n.a,{href:"https://livecodes.io/docs/sdk/headless",children:"headless mode"}),", in which this parameter is optional and can be omitted)."]}),"\n",(0,i.jsxs)(n.p,{children:["\u2022 ",(0,i.jsx)(n.strong,{children:"options?"}),": ",(0,i.jsx)(n.a,{href:"/docs/api/interfaces/EmbedOptions",children:(0,i.jsx)(n.code,{children:"EmbedOptions"})})]}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.a,{href:"https://livecodes.io/docs/sdk/js-ts#embed-options",children:"embed options"})," for the playground (optional)."]}),"\n",(0,i.jsx)(n.h3,{id:"returns",children:"Returns"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Promise"}),"<",(0,i.jsx)(n.a,{href:"/docs/api/interfaces/Playground",children:(0,i.jsx)(n.code,{children:"Playground"})}),">"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["A promise that resolves to a ",(0,i.jsx)(n.a,{href:"https://livecodes.io/docs/api/interfaces/Playground/",children:(0,i.jsx)(n.code,{children:"Playground"})})," object which exposes many ",(0,i.jsx)(n.a,{href:"https://livecodes.io/docs/sdk/js-ts/#sdk-methods",children:"SDK methods"})," that can be used to interact with the playground."]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"defined-in",children:"Defined in"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.a,{href:"https://github.com/live-codes/livecodes/blob/7617d5c8be5a2a8be8133f973d9e69eb9f86434d/src/sdk/index.ts#L26",children:"index.ts:26"})}),"\n",(0,i.jsx)(n.h2,{id:"createplaygroundoptions",children:"createPlayground(options)"}),"\n",(0,i.jsxs)(n.blockquote,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"createPlayground"}),"(",(0,i.jsx)(n.code,{children:"options"}),"): ",(0,i.jsx)(n.code,{children:"Promise"}),"<",(0,i.jsx)(n.a,{href:"/docs/api/interfaces/Playground",children:(0,i.jsx)(n.code,{children:"Playground"})}),">"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"parameters-1",children:"Parameters"}),"\n",(0,i.jsxs)(n.p,{children:["\u2022 ",(0,i.jsx)(n.strong,{children:"options"}),": ",(0,i.jsx)(n.a,{href:"/docs/api/interfaces/EmbedOptions",children:(0,i.jsx)(n.code,{children:"EmbedOptions"})})," & ",(0,i.jsx)(n.code,{children:"object"})]}),"\n",(0,i.jsx)(n.h3,{id:"returns-1",children:"Returns"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Promise"}),"<",(0,i.jsx)(n.a,{href:"/docs/api/interfaces/Playground",children:(0,i.jsx)(n.code,{children:"Playground"})}),">"]}),"\n",(0,i.jsx)(n.h3,{id:"defined-in-1",children:"Defined in"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.a,{href:"https://github.com/live-codes/livecodes/blob/7617d5c8be5a2a8be8133f973d9e69eb9f86434d/src/sdk/index.ts#L30",children:"index.ts:30"})})]})}function h(e={}){let{wrapper:n}={...(0,d.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},65:function(e,n,r){r.d(n,{Z:function(){return t},a:function(){return o}});var s=r(7294);let i={},d=s.createContext(i);function o(e){let n=s.useContext(d);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function t(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),s.createElement(d.Provider,{value:n},e.children)}}}]); |