@spidunno/desmos-types 1.13.6 → 1.13.8

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.
@@ -266,12 +266,182 @@ declare namespace Desmos {
266
266
  * @defaultValue a random 128-bit hex string
267
267
  */
268
268
  randomSeed?: string;
269
+ /**
270
+ * Turn on Complex Mode, so expressions can use complex numbers. Ignored
271
+ * (forced to `false`) when `allowComplex` is `false`, and turns off
272
+ * `degreeMode`.
273
+ * @defaultValue `false`
274
+ * @remarks Undocumented.
275
+ */
276
+ complex?: boolean;
277
+ /**
278
+ * Draw the grid, axes and numbers only in the first quadrant.
279
+ * @defaultValue `false`
280
+ * @remarks Undocumented.
281
+ */
282
+ restrictGridToFirstQuadrant?: boolean;
283
+ /**
284
+ * The "lock viewport" toggle in the graph settings, which stops the user
285
+ * from panning and zooming. Unlike `lockViewport`, it is part of the graph
286
+ * state.
287
+ * @defaultValue `false`
288
+ * @remarks Undocumented.
289
+ */
290
+ userLockedViewport?: boolean;
291
+ }
292
+
293
+ /**
294
+ * Configuration options the docs don't mention that still appear on
295
+ * `calculator.settings`.
296
+ *
297
+ * @remarks Undocumented: may change without notice.
298
+ */
299
+ interface UndocumentedGraphingCalculatorConfig {
300
+ /**
301
+ * Show the author features enabled by `authorFeatures`. With `false`, they
302
+ * stay available but hidden, as when an author previews the student view.
303
+ * @defaultValue `true`
304
+ */
305
+ authorMode?: boolean;
306
+ /** Allow the advanced styling options in the style menu. @defaultValue `false` */
307
+ advancedStyling?: boolean;
308
+ /** Allow defining functions, like `f(x)=x^2`. @defaultValue `true` */
309
+ functionDefinition?: boolean;
310
+ /** 3D: put the viewport controls on the left instead of the right. @defaultValue `false` */
311
+ leftAlign3dViewportControls?: boolean;
312
+ /** 3D: draw surfaces with their opacity. When `false`, surfaces are opaque. @defaultValue `false` */
313
+ translucentSurfaces?: boolean;
314
+ /** Show keyboard shortcuts in tooltips. @defaultValue `false` */
315
+ showKeyboardShortcutsInTooltips?: boolean;
316
+ /** Show a performance meter over the graph paper. @defaultValue `false` */
317
+ showPerformanceMeter?: boolean;
318
+ }
319
+
320
+ /**
321
+ * Options Desmos uses for its own products, debugging and embedding. They
322
+ * are accepted by the constructor and `updateSettings()` but never appear
323
+ * on `calculator.settings`.
324
+ *
325
+ * @remarks Undocumented: may change without notice.
326
+ */
327
+ interface InternalGraphingCalculatorOptions {
328
+ /**
329
+ * Which product the calculator behaves as. `Desmos.Geometry` and
330
+ * `Desmos.Calculator3D` set this themselves.
331
+ * @defaultValue `'graphing'`
332
+ */
333
+ product?: 'graphing' | 'geometry-calculator' | 'graphing-3d';
334
+ /** Show the Desmos branding on the graph paper. @defaultValue `true` */
335
+ branding?: boolean;
336
+ /** Only trace and show points of interest for the selected expression. @defaultValue `false` */
337
+ onlyTraceSelected?: boolean;
338
+ /** Ignore mouse and touch input on the graph paper. @defaultValue `false` */
339
+ disableMouseInteractions?: boolean;
340
+ /** Accepted, but not read anywhere in the v1.13 bundle. @defaultValue `false` */
341
+ nativeOnscreenKeypad?: boolean;
342
+ /** 3D: draw surfaces as wireframes. @defaultValue `false` */
343
+ wireframe?: boolean;
344
+ /** 3D: debug rendering that shows ray-casting cost as a heat map. @defaultValue `false` */
345
+ raycastHeatmap?: boolean;
346
+ /** 3D: debugging flag for surface cost estimates (shows them in the expression list). @defaultValue `false` */
347
+ ignoreCostEstimate?: boolean;
348
+ /** 3D: ray-cast without interval arithmetic (debugging). @defaultValue `false` */
349
+ raycastDisableIntervals?: boolean;
350
+ /**
351
+ * With `pasteGraphLink`, called with the state of a pasted graph link
352
+ * before it is imported. Call `done(null, state)` to import it (possibly
353
+ * modified), or `done(error)` to reject it.
354
+ * @defaultValue imports the state unchanged
355
+ */
356
+ pasteGraphLinkCallback?: (state: GraphState, done: (error: unknown, state?: GraphState) => void) => void;
357
+ /** Link the branding to desmos.com, where the graph can be edited. @defaultValue `false` */
358
+ editOnWeb?: boolean;
359
+ /** Desmos testing: post the cross-origin save test to the current origin. @defaultValue `false` */
360
+ crossOriginSaveTest?: boolean;
361
+ /** Make the graph paper and its objects reachable with Tab. @defaultValue `true` */
362
+ enableTabindex?: boolean;
363
+ /** Audio Trace: step through expressions in reverse order. @defaultValue `false` */
364
+ audioTraceReverseExpressions?: boolean;
365
+ /** Draw the graph paper with a transparent background. @defaultValue `false` */
366
+ transparentBackground?: boolean;
367
+ /** Stop animating while the calculator is scrolled out of view. @defaultValue `false` */
368
+ pauseWhenOffscreen?: boolean;
369
+ /** 3D: release the WebGL context while the calculator is out of view. @defaultValue `true` */
370
+ releaseContextWhenOffscreen?: boolean;
371
+ /** Geometry: hide the geometry toolbar and tools. @defaultValue `false` */
372
+ hideGeoUI?: boolean;
373
+ /** 3D: beta features, such as per-surface resolution and translucent surfaces. @defaultValue `false` */
374
+ beta3d?: boolean;
375
+ /** Allow strings (categorical data) in expressions. @defaultValue `false` */
376
+ categoricalData?: boolean;
377
+ /** Pause the evaluator while the user is zooming. @defaultValue `false` */
378
+ disableWorkerOnZoom?: boolean;
379
+ /** Cache rendered SVG images. @defaultValue `false` */
380
+ cacheRenderedSvgs?: boolean;
381
+ /** Graph hidden expressions too (the "ghost mode" checkbox in advanced settings). @defaultValue `false` */
382
+ ghostMode?: boolean;
383
+ /** Geometry: draw an arc on reflection previews. @defaultValue `false` */
384
+ reflectionArc?: boolean;
385
+ /** Log the evaluator's internal errors to the console. @defaultValue `false` */
386
+ logInternalErrors?: boolean;
387
+ /** Show the compiler debugging panel. @defaultValue `false` */
388
+ debugCompiler?: boolean;
389
+ /** Show each item's id in the expression list. @defaultValue `false` */
390
+ showIDs?: boolean;
391
+ /** Show the evaluator's progress on each item, with a legend. @defaultValue `false` */
392
+ debugProgressUpdates?: boolean;
393
+ /** Maximum depth of recursive function calls, from 1 to 1,000,000. @defaultValue the evaluator's built-in limit */
394
+ recursionDepthLimit?: number;
395
+ /** Never narrate coordinates to screen readers, except during Audio Trace. @defaultValue `false` */
396
+ reportPositionNone?: boolean;
397
+ /** The calculator is embedded in a Desmos notebook. @defaultValue `false` */
398
+ insideDesNotebook?: boolean;
399
+ /** The expression list is rendered outside the calculator (split panel). @defaultValue `false` */
400
+ expressionsExternal?: boolean;
401
+ /** 3D: show the orientation buttons. @defaultValue `true` */
402
+ orientationButtons?: boolean;
403
+ /** Accepted, but not read anywhere in the v1.13 bundle. */
404
+ debug3dRender?: unknown;
405
+ /** 3D: force this many depth-peeling layers for translucent surfaces. @defaultValue chosen from the scene */
406
+ debugPeelLayers?: number;
407
+ /** 3D: choose the number of depth-peeling layers from the scene. @defaultValue `true` */
408
+ adaptivePeeling?: boolean;
409
+ /** Accepted, but not read anywhere in the v1.13 bundle. */
410
+ debugPixelRatio?: unknown;
411
+ /** 3D: opacity (as LaTeX) given to new translucent surfaces. @defaultValue `'0.8'` */
412
+ translucentOpacity?: Latex;
413
+ /** 3D: samples per pixel for depth peeling. @defaultValue chosen from the device pixel ratio */
414
+ peelUpsample?: number;
415
+ /** 3D: render surfaces by ray casting. @defaultValue `false` */
416
+ rayCast?: boolean;
417
+ }
418
+
419
+ /**
420
+ * Old options that still work: the calculator logs a deprecation warning
421
+ * and sets the replacement.
422
+ */
423
+ interface DeprecatedGraphingCalculatorOptions {
424
+ /** @deprecated Use `settingsMenu` and `expressionsTopbar`, which this sets. */
425
+ menus?: boolean;
426
+ /** @deprecated Use `pointsOfInterest`, which this sets. */
427
+ solutions?: boolean;
428
+ /** @deprecated Removed in API v1.0; ignored. */
429
+ singleVariableSolutions?: boolean;
430
+ /** @deprecated Use `actions`; `true` sets `actions: true`. */
431
+ clickableObjects?: boolean;
432
+ /** @deprecated Use `authorFeatures`, which this sets. */
433
+ administerSecretFolders?: boolean;
269
434
  }
270
435
 
271
436
  type AxisScale = 'linear' | 'logarithmic';
272
437
 
273
438
  /** Everything that can be passed to the `GraphingCalculator` constructor or `updateSettings()`. */
274
- interface GraphingCalculatorOptions extends GraphingCalculatorConfig, GraphSettings {}
439
+ interface GraphingCalculatorOptions
440
+ extends GraphingCalculatorConfig,
441
+ GraphSettings,
442
+ UndocumentedGraphingCalculatorConfig,
443
+ InternalGraphingCalculatorOptions,
444
+ DeprecatedGraphingCalculatorOptions {}
275
445
 
276
446
  /** Options for `Desmos.Geometry`. Any graphing calculator option is accepted. */
277
447
  type GeometryOptions = GraphingCalculatorOptions;
@@ -284,37 +454,18 @@ declare namespace Desmos {
284
454
  | 'substitutions'
285
455
  | 'regressionTemplates'
286
456
  | 'intervalComprehensions'
287
- | 'recursion';
288
-
289
- /**
290
- * Settings present on `calculator.settings` at runtime that the docs don't
291
- * mention. They are read-only here because their behavior when set is not
292
- * part of the public API.
293
- *
294
- * @remarks Undocumented: may change without notice.
295
- */
296
- interface UndocumentedGraphingSettings {
297
- /** Whether Complex Mode is currently on. */
298
- readonly complex: boolean;
299
- readonly functionDefinition: boolean;
300
- readonly restrictGridToFirstQuadrant: boolean;
301
- readonly userLockedViewport: boolean;
302
- readonly authorMode: boolean;
303
- readonly advancedStyling: boolean;
304
- readonly leftAlign3dViewportControls: boolean;
305
- readonly translucentSurfaces: boolean;
306
- readonly showKeyboardShortcutsInTooltips: boolean;
307
- readonly showPerformanceMeter: boolean;
308
- }
457
+ | 'recursion'
458
+ | keyof InternalGraphingCalculatorOptions
459
+ | keyof DeprecatedGraphingCalculatorOptions;
309
460
 
310
- /** The current value of every documented option and graph setting. */
461
+ /** The current value of every option and graph setting that appears on `calculator.settings`. */
311
462
  type GraphingCalculatorSettingsValues = {
312
463
  readonly [K in Exclude<keyof GraphingCalculatorOptions, WriteOnlyGraphingOption | 'graphDescription'>]-?: NonNullable<
313
464
  GraphingCalculatorOptions[K]
314
465
  >;
315
466
  } & {
316
467
  readonly graphDescription: string | undefined;
317
- } & UndocumentedGraphingSettings;
468
+ };
318
469
 
319
470
  /**
320
471
  * `calculator.settings`: the current settings, observable per property.