Skip to content

Commit a66cfbe

Browse files
add imports
1 parent 37965de commit a66cfbe

1 file changed

Lines changed: 43 additions & 23 deletions

File tree

packages/quarto-types/src/quarto-api.ts

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@
44
* Copyright (C) 2023 Posit Software, PBC
55
*/
66

7-
import { MappedString } from './text-types.ts';
8-
import { Metadata } from './metadata-types.ts';
9-
import { PartitionedMarkdown } from './execution-engine.ts';
7+
import { MappedString } from "./text-types.ts";
8+
import { Metadata } from "./metadata-types.ts";
9+
import { PartitionedMarkdown } from "./execution-engine.ts";
1010
import type {
11+
FormatPandoc,
12+
JupyterCapabilities,
13+
JupyterKernelspec,
1114
JupyterNotebook,
15+
JupyterNotebookAssetPaths,
1216
JupyterToMarkdownOptions,
1317
JupyterToMarkdownResult,
14-
JupyterNotebookAssetPaths,
1518
JupyterWidgetDependencies,
16-
FormatPandoc,
17-
} from './jupyter-types.ts';
18-
import { PandocIncludes, PostProcessOptions } from './execution-engine.ts';
19-
import { Format } from './metadata-types.ts';
20-
import { EngineProjectContext } from './project-context.ts';
19+
} from "./jupyter-types.ts";
20+
import { PandocIncludes, PostProcessOptions } from "./execution-engine.ts";
21+
import { Format } from "./metadata-types.ts";
22+
import { EngineProjectContext } from "./project-context.ts";
2123

2224
/**
2325
* Process execution result
@@ -154,7 +156,10 @@ export interface QuartoAPI {
154156
* @param offset - Character offset to convert
155157
* @returns Line and column numbers (1-indexed)
156158
*/
157-
indexToLineCol: (str: MappedString, offset: number) => { line: number; column: number };
159+
indexToLineCol: (
160+
str: MappedString,
161+
offset: number,
162+
) => { line: number; column: number };
158163
};
159164

160165
/**
@@ -212,7 +217,7 @@ export interface QuartoAPI {
212217
*/
213218
toMarkdown: (
214219
nb: JupyterNotebook,
215-
options: JupyterToMarkdownOptions
220+
options: JupyterToMarkdownOptions,
216221
) => Promise<JupyterToMarkdownResult>;
217222

218223
/**
@@ -251,7 +256,7 @@ export interface QuartoAPI {
251256
quartoMdToJupyter: (
252257
markdown: string,
253258
includeIds: boolean,
254-
project?: EngineProjectContext
259+
project?: EngineProjectContext,
255260
) => Promise<JupyterNotebook>;
256261

257262
// 3. Notebook Processing & Assets
@@ -265,7 +270,7 @@ export interface QuartoAPI {
265270
*/
266271
notebookFiltered: (
267272
nb: JupyterNotebook,
268-
filters: string[]
273+
filters: string[],
269274
) => JupyterNotebook;
270275

271276
/**
@@ -286,7 +291,7 @@ export interface QuartoAPI {
286291
*/
287292
widgetDependencyIncludes: (
288293
deps: JupyterWidgetDependencies,
289-
tempDir: string
294+
tempDir: string,
290295
) => PandocIncludes;
291296

292297
/**
@@ -296,15 +301,20 @@ export interface QuartoAPI {
296301
* @param dependencies - Widget dependencies from execution result
297302
* @returns Pandoc includes structure
298303
*/
299-
resultIncludes: (tempDir: string, dependencies?: JupyterWidgetDependencies) => PandocIncludes;
304+
resultIncludes: (
305+
tempDir: string,
306+
dependencies?: JupyterWidgetDependencies,
307+
) => PandocIncludes;
300308

301309
/**
302310
* Extract engine dependencies from result dependencies
303311
*
304312
* @param dependencies - Widget dependencies from execution result
305313
* @returns Array of widget dependencies or undefined
306314
*/
307-
resultEngineDependencies: (dependencies?: JupyterWidgetDependencies) => Array<JupyterWidgetDependencies> | undefined;
315+
resultEngineDependencies: (
316+
dependencies?: JupyterWidgetDependencies,
317+
) => Array<JupyterWidgetDependencies> | undefined;
308318

309319
// 4. Runtime & Environment
310320

@@ -325,7 +335,7 @@ export interface QuartoAPI {
325335
*/
326336
capabilities: (
327337
python?: string,
328-
jupyter?: string
338+
jupyter?: string,
329339
) => Promise<JupyterCapabilities>;
330340

331341
/**
@@ -337,7 +347,7 @@ export interface QuartoAPI {
337347
*/
338348
capabilitiesMessage: (
339349
caps: JupyterCapabilities,
340-
extraMessage?: string
350+
extraMessage?: string,
341351
) => string;
342352

343353
/**
@@ -431,7 +441,10 @@ export interface QuartoAPI {
431441
* @param engine - Execution engine name
432442
* @returns True if format is server: shiny with jupyter engine
433443
*/
434-
isServerShinyPython: (format: Format, engine: string | undefined) => boolean;
444+
isServerShinyPython: (
445+
format: Format,
446+
engine: string | undefined,
447+
) => boolean;
435448
};
436449

437450
/**
@@ -565,7 +578,7 @@ export interface QuartoAPI {
565578
mergeOutput?: "stderr>stdout" | "stdout>stderr",
566579
stderrFilter?: (output: string) => string,
567580
respectStreams?: boolean,
568-
timeout?: number
581+
timeout?: number,
569582
) => Promise<ProcessResult>;
570583

571584
/**
@@ -609,7 +622,11 @@ export interface QuartoAPI {
609622
* @param lenient - Whether to use lenient parsing (default: false)
610623
* @returns Promise resolving to chunks with cells
611624
*/
612-
breakQuartoMd: (src: string | MappedString, validate?: boolean, lenient?: boolean) => Promise<QuartoMdChunks>;
625+
breakQuartoMd: (
626+
src: string | MappedString,
627+
validate?: boolean,
628+
lenient?: boolean,
629+
) => Promise<QuartoMdChunks>;
613630
};
614631

615632
/**
@@ -631,7 +648,10 @@ export interface QuartoAPI {
631648
* @param trim - Which empty lines to trim (default: "all")
632649
* @returns Trimmed array of lines
633650
*/
634-
trimEmptyLines: (lines: string[], trim?: "leading" | "trailing" | "all") => string[];
651+
trimEmptyLines: (
652+
lines: string[],
653+
trim?: "leading" | "trailing" | "all",
654+
) => string[];
635655

636656
/**
637657
* Restore preserved HTML in post-processing
@@ -658,4 +678,4 @@ export interface QuartoAPI {
658678
/**
659679
* Global Quarto API object
660680
*/
661-
export declare const quartoAPI: QuartoAPI;
681+
export declare const quartoAPI: QuartoAPI;

0 commit comments

Comments
 (0)