@spidunno/desmos-types 1.13.6 → 1.13.7
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.
- package/README.md +4 -3
- package/module/index.d.ts +176 -25
- package/module/internals.d.ts +176 -25
- package/package.json +1 -1
- package/types/options/graphing.d.ts +176 -25
package/README.md
CHANGED
|
@@ -6,11 +6,11 @@ the graphing calculator, geometry tool, 3D calculator, and the four-function and
|
|
|
6
6
|
## Install
|
|
7
7
|
|
|
8
8
|
```sh
|
|
9
|
-
npm install --save-dev @spidunno/desmos-types@~1.13.
|
|
9
|
+
npm install --save-dev @spidunno/desmos-types@~1.13.7
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
The package's major and minor version match the Desmos API version it describes; patch releases
|
|
13
|
-
are fixes to the types. Use a tilde range (`~1.13.
|
|
13
|
+
are fixes to the types. Use a tilde range (`~1.13.7`), not npm's default caret (`^`), so you only
|
|
14
14
|
get type fixes for the API version you load.
|
|
15
15
|
|
|
16
16
|
## Usage
|
|
@@ -124,7 +124,8 @@ members are typed separately (see [Internals](#internals)). `Desmos.TestInternal
|
|
|
124
124
|
- `Desmos.Colors.GREEN` is `#348543`, not the documented `#388c46`. The palette still cycles through `#388c46` for new items.
|
|
125
125
|
- `asyncScreenshot()` without a `mode` uses `'preserveX'` when the axes are square and `'stretch'` otherwise, not the documented `'contain'`.
|
|
126
126
|
- On `Calculator3D`, `asyncScreenshot()` always throws, and `mathToPixels` / `pixelsToMath` are `undefined`. The types leave all three out.
|
|
127
|
-
- `
|
|
127
|
+
- The calculator accepts many options the docs don't mention, such as `complex`, `restrictGridToFirstQuadrant` and `advancedStyling`. All of them are typed (as `UndocumentedGraphingCalculatorConfig`, `InternalGraphingCalculatorOptions` and the undocumented members of `GraphSettings`), along with the deprecated aliases (`menus`, `solutions`, ...), which are marked `@deprecated`.
|
|
128
|
+
- `substitutions`, `regressionTemplates`, `intervalComprehensions`, `recursion` and the internal and deprecated options are accepted but never appear on `calculator.settings`.
|
|
128
129
|
- `setMathBounds()` also accepts `{ xmin, xmax, ymin, ymax }`, plus `zmin` / `zmax` on 3D.
|
|
129
130
|
|
|
130
131
|
## Internals
|
package/module/index.d.ts
CHANGED
|
@@ -568,12 +568,182 @@ declare namespace Desmos {
|
|
|
568
568
|
* @defaultValue a random 128-bit hex string
|
|
569
569
|
*/
|
|
570
570
|
randomSeed?: string;
|
|
571
|
+
/**
|
|
572
|
+
* Turn on Complex Mode, so expressions can use complex numbers. Ignored
|
|
573
|
+
* (forced to `false`) when `allowComplex` is `false`, and turns off
|
|
574
|
+
* `degreeMode`.
|
|
575
|
+
* @defaultValue `false`
|
|
576
|
+
* @remarks Undocumented.
|
|
577
|
+
*/
|
|
578
|
+
complex?: boolean;
|
|
579
|
+
/**
|
|
580
|
+
* Draw the grid, axes and numbers only in the first quadrant.
|
|
581
|
+
* @defaultValue `false`
|
|
582
|
+
* @remarks Undocumented.
|
|
583
|
+
*/
|
|
584
|
+
restrictGridToFirstQuadrant?: boolean;
|
|
585
|
+
/**
|
|
586
|
+
* The "lock viewport" toggle in the graph settings, which stops the user
|
|
587
|
+
* from panning and zooming. Unlike `lockViewport`, it is part of the graph
|
|
588
|
+
* state.
|
|
589
|
+
* @defaultValue `false`
|
|
590
|
+
* @remarks Undocumented.
|
|
591
|
+
*/
|
|
592
|
+
userLockedViewport?: boolean;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Configuration options the docs don't mention that still appear on
|
|
597
|
+
* `calculator.settings`.
|
|
598
|
+
*
|
|
599
|
+
* @remarks Undocumented: may change without notice.
|
|
600
|
+
*/
|
|
601
|
+
interface UndocumentedGraphingCalculatorConfig {
|
|
602
|
+
/**
|
|
603
|
+
* Show the author features enabled by `authorFeatures`. With `false`, they
|
|
604
|
+
* stay available but hidden, as when an author previews the student view.
|
|
605
|
+
* @defaultValue `true`
|
|
606
|
+
*/
|
|
607
|
+
authorMode?: boolean;
|
|
608
|
+
/** Allow the advanced styling options in the style menu. @defaultValue `false` */
|
|
609
|
+
advancedStyling?: boolean;
|
|
610
|
+
/** Allow defining functions, like `f(x)=x^2`. @defaultValue `true` */
|
|
611
|
+
functionDefinition?: boolean;
|
|
612
|
+
/** 3D: put the viewport controls on the left instead of the right. @defaultValue `false` */
|
|
613
|
+
leftAlign3dViewportControls?: boolean;
|
|
614
|
+
/** 3D: draw surfaces with their opacity. When `false`, surfaces are opaque. @defaultValue `false` */
|
|
615
|
+
translucentSurfaces?: boolean;
|
|
616
|
+
/** Show keyboard shortcuts in tooltips. @defaultValue `false` */
|
|
617
|
+
showKeyboardShortcutsInTooltips?: boolean;
|
|
618
|
+
/** Show a performance meter over the graph paper. @defaultValue `false` */
|
|
619
|
+
showPerformanceMeter?: boolean;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Options Desmos uses for its own products, debugging and embedding. They
|
|
624
|
+
* are accepted by the constructor and `updateSettings()` but never appear
|
|
625
|
+
* on `calculator.settings`.
|
|
626
|
+
*
|
|
627
|
+
* @remarks Undocumented: may change without notice.
|
|
628
|
+
*/
|
|
629
|
+
interface InternalGraphingCalculatorOptions {
|
|
630
|
+
/**
|
|
631
|
+
* Which product the calculator behaves as. `Desmos.Geometry` and
|
|
632
|
+
* `Desmos.Calculator3D` set this themselves.
|
|
633
|
+
* @defaultValue `'graphing'`
|
|
634
|
+
*/
|
|
635
|
+
product?: 'graphing' | 'geometry-calculator' | 'graphing-3d';
|
|
636
|
+
/** Show the Desmos branding on the graph paper. @defaultValue `true` */
|
|
637
|
+
branding?: boolean;
|
|
638
|
+
/** Only trace and show points of interest for the selected expression. @defaultValue `false` */
|
|
639
|
+
onlyTraceSelected?: boolean;
|
|
640
|
+
/** Ignore mouse and touch input on the graph paper. @defaultValue `false` */
|
|
641
|
+
disableMouseInteractions?: boolean;
|
|
642
|
+
/** Accepted, but not read anywhere in the v1.13 bundle. @defaultValue `false` */
|
|
643
|
+
nativeOnscreenKeypad?: boolean;
|
|
644
|
+
/** 3D: draw surfaces as wireframes. @defaultValue `false` */
|
|
645
|
+
wireframe?: boolean;
|
|
646
|
+
/** 3D: debug rendering that shows ray-casting cost as a heat map. @defaultValue `false` */
|
|
647
|
+
raycastHeatmap?: boolean;
|
|
648
|
+
/** 3D: debugging flag for surface cost estimates (shows them in the expression list). @defaultValue `false` */
|
|
649
|
+
ignoreCostEstimate?: boolean;
|
|
650
|
+
/** 3D: ray-cast without interval arithmetic (debugging). @defaultValue `false` */
|
|
651
|
+
raycastDisableIntervals?: boolean;
|
|
652
|
+
/**
|
|
653
|
+
* With `pasteGraphLink`, called with the state of a pasted graph link
|
|
654
|
+
* before it is imported. Call `done(null, state)` to import it (possibly
|
|
655
|
+
* modified), or `done(error)` to reject it.
|
|
656
|
+
* @defaultValue imports the state unchanged
|
|
657
|
+
*/
|
|
658
|
+
pasteGraphLinkCallback?: (state: GraphState, done: (error: unknown, state?: GraphState) => void) => void;
|
|
659
|
+
/** Link the branding to desmos.com, where the graph can be edited. @defaultValue `false` */
|
|
660
|
+
editOnWeb?: boolean;
|
|
661
|
+
/** Desmos testing: post the cross-origin save test to the current origin. @defaultValue `false` */
|
|
662
|
+
crossOriginSaveTest?: boolean;
|
|
663
|
+
/** Make the graph paper and its objects reachable with Tab. @defaultValue `true` */
|
|
664
|
+
enableTabindex?: boolean;
|
|
665
|
+
/** Audio Trace: step through expressions in reverse order. @defaultValue `false` */
|
|
666
|
+
audioTraceReverseExpressions?: boolean;
|
|
667
|
+
/** Draw the graph paper with a transparent background. @defaultValue `false` */
|
|
668
|
+
transparentBackground?: boolean;
|
|
669
|
+
/** Stop animating while the calculator is scrolled out of view. @defaultValue `false` */
|
|
670
|
+
pauseWhenOffscreen?: boolean;
|
|
671
|
+
/** 3D: release the WebGL context while the calculator is out of view. @defaultValue `true` */
|
|
672
|
+
releaseContextWhenOffscreen?: boolean;
|
|
673
|
+
/** Geometry: hide the geometry toolbar and tools. @defaultValue `false` */
|
|
674
|
+
hideGeoUI?: boolean;
|
|
675
|
+
/** 3D: beta features, such as per-surface resolution and translucent surfaces. @defaultValue `false` */
|
|
676
|
+
beta3d?: boolean;
|
|
677
|
+
/** Allow strings (categorical data) in expressions. @defaultValue `false` */
|
|
678
|
+
categoricalData?: boolean;
|
|
679
|
+
/** Pause the evaluator while the user is zooming. @defaultValue `false` */
|
|
680
|
+
disableWorkerOnZoom?: boolean;
|
|
681
|
+
/** Cache rendered SVG images. @defaultValue `false` */
|
|
682
|
+
cacheRenderedSvgs?: boolean;
|
|
683
|
+
/** Graph hidden expressions too (the "ghost mode" checkbox in advanced settings). @defaultValue `false` */
|
|
684
|
+
ghostMode?: boolean;
|
|
685
|
+
/** Geometry: draw an arc on reflection previews. @defaultValue `false` */
|
|
686
|
+
reflectionArc?: boolean;
|
|
687
|
+
/** Log the evaluator's internal errors to the console. @defaultValue `false` */
|
|
688
|
+
logInternalErrors?: boolean;
|
|
689
|
+
/** Show the compiler debugging panel. @defaultValue `false` */
|
|
690
|
+
debugCompiler?: boolean;
|
|
691
|
+
/** Show each item's id in the expression list. @defaultValue `false` */
|
|
692
|
+
showIDs?: boolean;
|
|
693
|
+
/** Show the evaluator's progress on each item, with a legend. @defaultValue `false` */
|
|
694
|
+
debugProgressUpdates?: boolean;
|
|
695
|
+
/** Maximum depth of recursive function calls, from 1 to 1,000,000. @defaultValue the evaluator's built-in limit */
|
|
696
|
+
recursionDepthLimit?: number;
|
|
697
|
+
/** Never narrate coordinates to screen readers, except during Audio Trace. @defaultValue `false` */
|
|
698
|
+
reportPositionNone?: boolean;
|
|
699
|
+
/** The calculator is embedded in a Desmos notebook. @defaultValue `false` */
|
|
700
|
+
insideDesNotebook?: boolean;
|
|
701
|
+
/** The expression list is rendered outside the calculator (split panel). @defaultValue `false` */
|
|
702
|
+
expressionsExternal?: boolean;
|
|
703
|
+
/** 3D: show the orientation buttons. @defaultValue `true` */
|
|
704
|
+
orientationButtons?: boolean;
|
|
705
|
+
/** Accepted, but not read anywhere in the v1.13 bundle. */
|
|
706
|
+
debug3dRender?: unknown;
|
|
707
|
+
/** 3D: force this many depth-peeling layers for translucent surfaces. @defaultValue chosen from the scene */
|
|
708
|
+
debugPeelLayers?: number;
|
|
709
|
+
/** 3D: choose the number of depth-peeling layers from the scene. @defaultValue `true` */
|
|
710
|
+
adaptivePeeling?: boolean;
|
|
711
|
+
/** Accepted, but not read anywhere in the v1.13 bundle. */
|
|
712
|
+
debugPixelRatio?: unknown;
|
|
713
|
+
/** 3D: opacity (as LaTeX) given to new translucent surfaces. @defaultValue `'0.8'` */
|
|
714
|
+
translucentOpacity?: Latex;
|
|
715
|
+
/** 3D: samples per pixel for depth peeling. @defaultValue chosen from the device pixel ratio */
|
|
716
|
+
peelUpsample?: number;
|
|
717
|
+
/** 3D: render surfaces by ray casting. @defaultValue `false` */
|
|
718
|
+
rayCast?: boolean;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* Old options that still work: the calculator logs a deprecation warning
|
|
723
|
+
* and sets the replacement.
|
|
724
|
+
*/
|
|
725
|
+
interface DeprecatedGraphingCalculatorOptions {
|
|
726
|
+
/** @deprecated Use `settingsMenu` and `expressionsTopbar`, which this sets. */
|
|
727
|
+
menus?: boolean;
|
|
728
|
+
/** @deprecated Use `pointsOfInterest`, which this sets. */
|
|
729
|
+
solutions?: boolean;
|
|
730
|
+
/** @deprecated Removed in API v1.0; ignored. */
|
|
731
|
+
singleVariableSolutions?: boolean;
|
|
732
|
+
/** @deprecated Use `actions`; `true` sets `actions: true`. */
|
|
733
|
+
clickableObjects?: boolean;
|
|
734
|
+
/** @deprecated Use `authorFeatures`, which this sets. */
|
|
735
|
+
administerSecretFolders?: boolean;
|
|
571
736
|
}
|
|
572
737
|
|
|
573
738
|
type AxisScale = 'linear' | 'logarithmic';
|
|
574
739
|
|
|
575
740
|
/** Everything that can be passed to the `GraphingCalculator` constructor or `updateSettings()`. */
|
|
576
|
-
interface GraphingCalculatorOptions
|
|
741
|
+
interface GraphingCalculatorOptions
|
|
742
|
+
extends GraphingCalculatorConfig,
|
|
743
|
+
GraphSettings,
|
|
744
|
+
UndocumentedGraphingCalculatorConfig,
|
|
745
|
+
InternalGraphingCalculatorOptions,
|
|
746
|
+
DeprecatedGraphingCalculatorOptions {}
|
|
577
747
|
|
|
578
748
|
/** Options for `Desmos.Geometry`. Any graphing calculator option is accepted. */
|
|
579
749
|
type GeometryOptions = GraphingCalculatorOptions;
|
|
@@ -586,37 +756,18 @@ declare namespace Desmos {
|
|
|
586
756
|
| 'substitutions'
|
|
587
757
|
| 'regressionTemplates'
|
|
588
758
|
| 'intervalComprehensions'
|
|
589
|
-
| 'recursion'
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
* Settings present on `calculator.settings` at runtime that the docs don't
|
|
593
|
-
* mention. They are read-only here because their behavior when set is not
|
|
594
|
-
* part of the public API.
|
|
595
|
-
*
|
|
596
|
-
* @remarks Undocumented: may change without notice.
|
|
597
|
-
*/
|
|
598
|
-
interface UndocumentedGraphingSettings {
|
|
599
|
-
/** Whether Complex Mode is currently on. */
|
|
600
|
-
readonly complex: boolean;
|
|
601
|
-
readonly functionDefinition: boolean;
|
|
602
|
-
readonly restrictGridToFirstQuadrant: boolean;
|
|
603
|
-
readonly userLockedViewport: boolean;
|
|
604
|
-
readonly authorMode: boolean;
|
|
605
|
-
readonly advancedStyling: boolean;
|
|
606
|
-
readonly leftAlign3dViewportControls: boolean;
|
|
607
|
-
readonly translucentSurfaces: boolean;
|
|
608
|
-
readonly showKeyboardShortcutsInTooltips: boolean;
|
|
609
|
-
readonly showPerformanceMeter: boolean;
|
|
610
|
-
}
|
|
759
|
+
| 'recursion'
|
|
760
|
+
| keyof InternalGraphingCalculatorOptions
|
|
761
|
+
| keyof DeprecatedGraphingCalculatorOptions;
|
|
611
762
|
|
|
612
|
-
/** The current value of every
|
|
763
|
+
/** The current value of every option and graph setting that appears on `calculator.settings`. */
|
|
613
764
|
type GraphingCalculatorSettingsValues = {
|
|
614
765
|
readonly [K in Exclude<keyof GraphingCalculatorOptions, WriteOnlyGraphingOption | 'graphDescription'>]-?: NonNullable<
|
|
615
766
|
GraphingCalculatorOptions[K]
|
|
616
767
|
>;
|
|
617
768
|
} & {
|
|
618
769
|
readonly graphDescription: string | undefined;
|
|
619
|
-
}
|
|
770
|
+
};
|
|
620
771
|
|
|
621
772
|
/**
|
|
622
773
|
* `calculator.settings`: the current settings, observable per property.
|
package/module/internals.d.ts
CHANGED
|
@@ -568,12 +568,182 @@ declare namespace Desmos {
|
|
|
568
568
|
* @defaultValue a random 128-bit hex string
|
|
569
569
|
*/
|
|
570
570
|
randomSeed?: string;
|
|
571
|
+
/**
|
|
572
|
+
* Turn on Complex Mode, so expressions can use complex numbers. Ignored
|
|
573
|
+
* (forced to `false`) when `allowComplex` is `false`, and turns off
|
|
574
|
+
* `degreeMode`.
|
|
575
|
+
* @defaultValue `false`
|
|
576
|
+
* @remarks Undocumented.
|
|
577
|
+
*/
|
|
578
|
+
complex?: boolean;
|
|
579
|
+
/**
|
|
580
|
+
* Draw the grid, axes and numbers only in the first quadrant.
|
|
581
|
+
* @defaultValue `false`
|
|
582
|
+
* @remarks Undocumented.
|
|
583
|
+
*/
|
|
584
|
+
restrictGridToFirstQuadrant?: boolean;
|
|
585
|
+
/**
|
|
586
|
+
* The "lock viewport" toggle in the graph settings, which stops the user
|
|
587
|
+
* from panning and zooming. Unlike `lockViewport`, it is part of the graph
|
|
588
|
+
* state.
|
|
589
|
+
* @defaultValue `false`
|
|
590
|
+
* @remarks Undocumented.
|
|
591
|
+
*/
|
|
592
|
+
userLockedViewport?: boolean;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Configuration options the docs don't mention that still appear on
|
|
597
|
+
* `calculator.settings`.
|
|
598
|
+
*
|
|
599
|
+
* @remarks Undocumented: may change without notice.
|
|
600
|
+
*/
|
|
601
|
+
interface UndocumentedGraphingCalculatorConfig {
|
|
602
|
+
/**
|
|
603
|
+
* Show the author features enabled by `authorFeatures`. With `false`, they
|
|
604
|
+
* stay available but hidden, as when an author previews the student view.
|
|
605
|
+
* @defaultValue `true`
|
|
606
|
+
*/
|
|
607
|
+
authorMode?: boolean;
|
|
608
|
+
/** Allow the advanced styling options in the style menu. @defaultValue `false` */
|
|
609
|
+
advancedStyling?: boolean;
|
|
610
|
+
/** Allow defining functions, like `f(x)=x^2`. @defaultValue `true` */
|
|
611
|
+
functionDefinition?: boolean;
|
|
612
|
+
/** 3D: put the viewport controls on the left instead of the right. @defaultValue `false` */
|
|
613
|
+
leftAlign3dViewportControls?: boolean;
|
|
614
|
+
/** 3D: draw surfaces with their opacity. When `false`, surfaces are opaque. @defaultValue `false` */
|
|
615
|
+
translucentSurfaces?: boolean;
|
|
616
|
+
/** Show keyboard shortcuts in tooltips. @defaultValue `false` */
|
|
617
|
+
showKeyboardShortcutsInTooltips?: boolean;
|
|
618
|
+
/** Show a performance meter over the graph paper. @defaultValue `false` */
|
|
619
|
+
showPerformanceMeter?: boolean;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Options Desmos uses for its own products, debugging and embedding. They
|
|
624
|
+
* are accepted by the constructor and `updateSettings()` but never appear
|
|
625
|
+
* on `calculator.settings`.
|
|
626
|
+
*
|
|
627
|
+
* @remarks Undocumented: may change without notice.
|
|
628
|
+
*/
|
|
629
|
+
interface InternalGraphingCalculatorOptions {
|
|
630
|
+
/**
|
|
631
|
+
* Which product the calculator behaves as. `Desmos.Geometry` and
|
|
632
|
+
* `Desmos.Calculator3D` set this themselves.
|
|
633
|
+
* @defaultValue `'graphing'`
|
|
634
|
+
*/
|
|
635
|
+
product?: 'graphing' | 'geometry-calculator' | 'graphing-3d';
|
|
636
|
+
/** Show the Desmos branding on the graph paper. @defaultValue `true` */
|
|
637
|
+
branding?: boolean;
|
|
638
|
+
/** Only trace and show points of interest for the selected expression. @defaultValue `false` */
|
|
639
|
+
onlyTraceSelected?: boolean;
|
|
640
|
+
/** Ignore mouse and touch input on the graph paper. @defaultValue `false` */
|
|
641
|
+
disableMouseInteractions?: boolean;
|
|
642
|
+
/** Accepted, but not read anywhere in the v1.13 bundle. @defaultValue `false` */
|
|
643
|
+
nativeOnscreenKeypad?: boolean;
|
|
644
|
+
/** 3D: draw surfaces as wireframes. @defaultValue `false` */
|
|
645
|
+
wireframe?: boolean;
|
|
646
|
+
/** 3D: debug rendering that shows ray-casting cost as a heat map. @defaultValue `false` */
|
|
647
|
+
raycastHeatmap?: boolean;
|
|
648
|
+
/** 3D: debugging flag for surface cost estimates (shows them in the expression list). @defaultValue `false` */
|
|
649
|
+
ignoreCostEstimate?: boolean;
|
|
650
|
+
/** 3D: ray-cast without interval arithmetic (debugging). @defaultValue `false` */
|
|
651
|
+
raycastDisableIntervals?: boolean;
|
|
652
|
+
/**
|
|
653
|
+
* With `pasteGraphLink`, called with the state of a pasted graph link
|
|
654
|
+
* before it is imported. Call `done(null, state)` to import it (possibly
|
|
655
|
+
* modified), or `done(error)` to reject it.
|
|
656
|
+
* @defaultValue imports the state unchanged
|
|
657
|
+
*/
|
|
658
|
+
pasteGraphLinkCallback?: (state: GraphState, done: (error: unknown, state?: GraphState) => void) => void;
|
|
659
|
+
/** Link the branding to desmos.com, where the graph can be edited. @defaultValue `false` */
|
|
660
|
+
editOnWeb?: boolean;
|
|
661
|
+
/** Desmos testing: post the cross-origin save test to the current origin. @defaultValue `false` */
|
|
662
|
+
crossOriginSaveTest?: boolean;
|
|
663
|
+
/** Make the graph paper and its objects reachable with Tab. @defaultValue `true` */
|
|
664
|
+
enableTabindex?: boolean;
|
|
665
|
+
/** Audio Trace: step through expressions in reverse order. @defaultValue `false` */
|
|
666
|
+
audioTraceReverseExpressions?: boolean;
|
|
667
|
+
/** Draw the graph paper with a transparent background. @defaultValue `false` */
|
|
668
|
+
transparentBackground?: boolean;
|
|
669
|
+
/** Stop animating while the calculator is scrolled out of view. @defaultValue `false` */
|
|
670
|
+
pauseWhenOffscreen?: boolean;
|
|
671
|
+
/** 3D: release the WebGL context while the calculator is out of view. @defaultValue `true` */
|
|
672
|
+
releaseContextWhenOffscreen?: boolean;
|
|
673
|
+
/** Geometry: hide the geometry toolbar and tools. @defaultValue `false` */
|
|
674
|
+
hideGeoUI?: boolean;
|
|
675
|
+
/** 3D: beta features, such as per-surface resolution and translucent surfaces. @defaultValue `false` */
|
|
676
|
+
beta3d?: boolean;
|
|
677
|
+
/** Allow strings (categorical data) in expressions. @defaultValue `false` */
|
|
678
|
+
categoricalData?: boolean;
|
|
679
|
+
/** Pause the evaluator while the user is zooming. @defaultValue `false` */
|
|
680
|
+
disableWorkerOnZoom?: boolean;
|
|
681
|
+
/** Cache rendered SVG images. @defaultValue `false` */
|
|
682
|
+
cacheRenderedSvgs?: boolean;
|
|
683
|
+
/** Graph hidden expressions too (the "ghost mode" checkbox in advanced settings). @defaultValue `false` */
|
|
684
|
+
ghostMode?: boolean;
|
|
685
|
+
/** Geometry: draw an arc on reflection previews. @defaultValue `false` */
|
|
686
|
+
reflectionArc?: boolean;
|
|
687
|
+
/** Log the evaluator's internal errors to the console. @defaultValue `false` */
|
|
688
|
+
logInternalErrors?: boolean;
|
|
689
|
+
/** Show the compiler debugging panel. @defaultValue `false` */
|
|
690
|
+
debugCompiler?: boolean;
|
|
691
|
+
/** Show each item's id in the expression list. @defaultValue `false` */
|
|
692
|
+
showIDs?: boolean;
|
|
693
|
+
/** Show the evaluator's progress on each item, with a legend. @defaultValue `false` */
|
|
694
|
+
debugProgressUpdates?: boolean;
|
|
695
|
+
/** Maximum depth of recursive function calls, from 1 to 1,000,000. @defaultValue the evaluator's built-in limit */
|
|
696
|
+
recursionDepthLimit?: number;
|
|
697
|
+
/** Never narrate coordinates to screen readers, except during Audio Trace. @defaultValue `false` */
|
|
698
|
+
reportPositionNone?: boolean;
|
|
699
|
+
/** The calculator is embedded in a Desmos notebook. @defaultValue `false` */
|
|
700
|
+
insideDesNotebook?: boolean;
|
|
701
|
+
/** The expression list is rendered outside the calculator (split panel). @defaultValue `false` */
|
|
702
|
+
expressionsExternal?: boolean;
|
|
703
|
+
/** 3D: show the orientation buttons. @defaultValue `true` */
|
|
704
|
+
orientationButtons?: boolean;
|
|
705
|
+
/** Accepted, but not read anywhere in the v1.13 bundle. */
|
|
706
|
+
debug3dRender?: unknown;
|
|
707
|
+
/** 3D: force this many depth-peeling layers for translucent surfaces. @defaultValue chosen from the scene */
|
|
708
|
+
debugPeelLayers?: number;
|
|
709
|
+
/** 3D: choose the number of depth-peeling layers from the scene. @defaultValue `true` */
|
|
710
|
+
adaptivePeeling?: boolean;
|
|
711
|
+
/** Accepted, but not read anywhere in the v1.13 bundle. */
|
|
712
|
+
debugPixelRatio?: unknown;
|
|
713
|
+
/** 3D: opacity (as LaTeX) given to new translucent surfaces. @defaultValue `'0.8'` */
|
|
714
|
+
translucentOpacity?: Latex;
|
|
715
|
+
/** 3D: samples per pixel for depth peeling. @defaultValue chosen from the device pixel ratio */
|
|
716
|
+
peelUpsample?: number;
|
|
717
|
+
/** 3D: render surfaces by ray casting. @defaultValue `false` */
|
|
718
|
+
rayCast?: boolean;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* Old options that still work: the calculator logs a deprecation warning
|
|
723
|
+
* and sets the replacement.
|
|
724
|
+
*/
|
|
725
|
+
interface DeprecatedGraphingCalculatorOptions {
|
|
726
|
+
/** @deprecated Use `settingsMenu` and `expressionsTopbar`, which this sets. */
|
|
727
|
+
menus?: boolean;
|
|
728
|
+
/** @deprecated Use `pointsOfInterest`, which this sets. */
|
|
729
|
+
solutions?: boolean;
|
|
730
|
+
/** @deprecated Removed in API v1.0; ignored. */
|
|
731
|
+
singleVariableSolutions?: boolean;
|
|
732
|
+
/** @deprecated Use `actions`; `true` sets `actions: true`. */
|
|
733
|
+
clickableObjects?: boolean;
|
|
734
|
+
/** @deprecated Use `authorFeatures`, which this sets. */
|
|
735
|
+
administerSecretFolders?: boolean;
|
|
571
736
|
}
|
|
572
737
|
|
|
573
738
|
type AxisScale = 'linear' | 'logarithmic';
|
|
574
739
|
|
|
575
740
|
/** Everything that can be passed to the `GraphingCalculator` constructor or `updateSettings()`. */
|
|
576
|
-
interface GraphingCalculatorOptions
|
|
741
|
+
interface GraphingCalculatorOptions
|
|
742
|
+
extends GraphingCalculatorConfig,
|
|
743
|
+
GraphSettings,
|
|
744
|
+
UndocumentedGraphingCalculatorConfig,
|
|
745
|
+
InternalGraphingCalculatorOptions,
|
|
746
|
+
DeprecatedGraphingCalculatorOptions {}
|
|
577
747
|
|
|
578
748
|
/** Options for `Desmos.Geometry`. Any graphing calculator option is accepted. */
|
|
579
749
|
type GeometryOptions = GraphingCalculatorOptions;
|
|
@@ -586,37 +756,18 @@ declare namespace Desmos {
|
|
|
586
756
|
| 'substitutions'
|
|
587
757
|
| 'regressionTemplates'
|
|
588
758
|
| 'intervalComprehensions'
|
|
589
|
-
| 'recursion'
|
|
759
|
+
| 'recursion'
|
|
760
|
+
| keyof InternalGraphingCalculatorOptions
|
|
761
|
+
| keyof DeprecatedGraphingCalculatorOptions;
|
|
590
762
|
|
|
591
|
-
/**
|
|
592
|
-
* Settings present on `calculator.settings` at runtime that the docs don't
|
|
593
|
-
* mention. They are read-only here because their behavior when set is not
|
|
594
|
-
* part of the public API.
|
|
595
|
-
*
|
|
596
|
-
* @remarks Undocumented: may change without notice.
|
|
597
|
-
*/
|
|
598
|
-
interface UndocumentedGraphingSettings {
|
|
599
|
-
/** Whether Complex Mode is currently on. */
|
|
600
|
-
readonly complex: boolean;
|
|
601
|
-
readonly functionDefinition: boolean;
|
|
602
|
-
readonly restrictGridToFirstQuadrant: boolean;
|
|
603
|
-
readonly userLockedViewport: boolean;
|
|
604
|
-
readonly authorMode: boolean;
|
|
605
|
-
readonly advancedStyling: boolean;
|
|
606
|
-
readonly leftAlign3dViewportControls: boolean;
|
|
607
|
-
readonly translucentSurfaces: boolean;
|
|
608
|
-
readonly showKeyboardShortcutsInTooltips: boolean;
|
|
609
|
-
readonly showPerformanceMeter: boolean;
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
/** The current value of every documented option and graph setting. */
|
|
763
|
+
/** The current value of every option and graph setting that appears on `calculator.settings`. */
|
|
613
764
|
type GraphingCalculatorSettingsValues = {
|
|
614
765
|
readonly [K in Exclude<keyof GraphingCalculatorOptions, WriteOnlyGraphingOption | 'graphDescription'>]-?: NonNullable<
|
|
615
766
|
GraphingCalculatorOptions[K]
|
|
616
767
|
>;
|
|
617
768
|
} & {
|
|
618
769
|
readonly graphDescription: string | undefined;
|
|
619
|
-
}
|
|
770
|
+
};
|
|
620
771
|
|
|
621
772
|
/**
|
|
622
773
|
* `calculator.settings`: the current settings, observable per property.
|
package/package.json
CHANGED
|
@@ -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
|
|
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
|
|
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
|
-
}
|
|
468
|
+
};
|
|
318
469
|
|
|
319
470
|
/**
|
|
320
471
|
* `calculator.settings`: the current settings, observable per property.
|