@codemirror/state 6.3.0 → 6.3.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 6.3.1 (2023-10-18)
2
+
3
+ ### Bug fixes
4
+
5
+ Give the tag property on `FacetReader` the type of the output type parameter to force TypeScript to infer the proper type when converting from `Facet` to `FacetReader`.
6
+
1
7
  ## 6.3.0 (2023-10-12)
2
8
 
3
9
  ### New features
package/dist/index.d.cts CHANGED
@@ -571,9 +571,8 @@ declare class Facet<Input, Output = readonly Input[]> implements FacetReader<Out
571
571
  */
572
572
  from<T extends Input>(field: StateField<T>): Extension;
573
573
  from<T>(field: StateField<T>, get: (value: T) => Input): Extension;
574
- tag: typeof FacetTag;
574
+ tag: Output;
575
575
  }
576
- declare const FacetTag: unique symbol;
577
576
  /**
578
577
  A facet reader can be used to fetch the value of a facet, though
579
578
  [`EditorState.facet`](https://codemirror.net/6/docs/ref/#state.EditorState.facet) or as a dependency
@@ -583,9 +582,10 @@ values for the facet.
583
582
  type FacetReader<Output> = {
584
583
  /**
585
584
  Dummy tag that makes sure TypeScript doesn't consider all object
586
- types as conforming to this type.
585
+ types as conforming to this type. Not actually present on the
586
+ object.
587
587
  */
588
- tag: typeof FacetTag;
588
+ tag: Output;
589
589
  };
590
590
  type Slot<T> = FacetReader<T> | StateField<T> | "doc" | "selection";
591
591
  type StateFieldSpec<Value> = {
package/dist/index.d.ts CHANGED
@@ -571,9 +571,8 @@ declare class Facet<Input, Output = readonly Input[]> implements FacetReader<Out
571
571
  */
572
572
  from<T extends Input>(field: StateField<T>): Extension;
573
573
  from<T>(field: StateField<T>, get: (value: T) => Input): Extension;
574
- tag: typeof FacetTag;
574
+ tag: Output;
575
575
  }
576
- declare const FacetTag: unique symbol;
577
576
  /**
578
577
  A facet reader can be used to fetch the value of a facet, though
579
578
  [`EditorState.facet`](https://codemirror.net/6/docs/ref/#state.EditorState.facet) or as a dependency
@@ -583,9 +582,10 @@ values for the facet.
583
582
  type FacetReader<Output> = {
584
583
  /**
585
584
  Dummy tag that makes sure TypeScript doesn't consider all object
586
- types as conforming to this type.
585
+ types as conforming to this type. Not actually present on the
586
+ object.
587
587
  */
588
- tag: typeof FacetTag;
588
+ tag: Output;
589
589
  };
590
590
  type Slot<T> = FacetReader<T> | StateField<T> | "doc" | "selection";
591
591
  type StateFieldSpec<Value> = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/state",
3
- "version": "6.3.0",
3
+ "version": "6.3.1",
4
4
  "description": "Editor state data structures for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",