MCPcopy
hub / github.com/simstudioai/sim / open

Method open

apps/sim/lib/pptx-renderer/core/viewer.ts:209–248  ·  view source on GitHub ↗
(
    input: PreviewInput,
    options?: {
      renderMode?: 'list' | 'slide'
      listOptions?: ListRenderOptions
      signal?: AbortSignal
    }
  )

Source from the content-addressed store, hash-verified

207 // -----------------------------------------------------------------------
208
209 async open(
210 input: PreviewInput,
211 options?: {
212 renderMode?: 'list' | 'slide'
213 listOptions?: ListRenderOptions
214 signal?: AbortSignal
215 }
216 ): Promise<void> {
217 const signal = options?.signal
218 const checkAborted = () => {
219 if (signal?.aborted) {
220 throw new DOMException('Preview aborted', 'AbortError')
221 }
222 }
223
224 checkAborted()
225
226 // Clean up previous state
227 this.destroy()
228
229 const buffer = await normalizePreviewInput(input)
230 checkAborted()
231
232 const files = await parseZip(buffer, this.viewerOptions.zipLimits)
233 checkAborted()
234
235 const presentation = buildPresentation(files)
236 checkAborted()
237
238 this.load(presentation)
239
240 const renderMode = options?.renderMode ?? 'list'
241 if (renderMode === 'slide') {
242 await this.renderSlide(0)
243 } else {
244 await this.renderList(options?.listOptions)
245 }
246
247 checkAborted()
248 }
249
250 // -----------------------------------------------------------------------
251 // Static factory

Callers 15

openSimPptxViewerFunction · 0.95
handleNavigateMethod · 0.80
uploadViaPresignedPutFunction · 0.80
QFunction · 0.80
pptxgenjs.cjsFile · 0.80
y7Function · 0.80
handleShareTwitterFunction · 0.80
handleShareLinkedInFunction · 0.80
LogsFunction · 0.80
handleDownloadFunction · 0.80
LoadedRichMarkdownEditorFunction · 0.80
TableGridFunction · 0.80

Calls 7

destroyMethod · 0.95
loadMethod · 0.95
renderSlideMethod · 0.95
renderListMethod · 0.95
parseZipFunction · 0.90
buildPresentationFunction · 0.90
normalizePreviewInputFunction · 0.85

Tested by

no test coverage detected