Skip to content

Commit

Permalink
chore: Fix types for TS 4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli committed May 29, 2022
1 parent 42e527a commit 7e9b489
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/doc/Document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export declare namespace Document {
}

export class Document<T extends Node = Node> {
readonly [NODE_TYPE]: symbol
declare readonly [NODE_TYPE]: symbol

/** A comment before this Document */
commentBefore: string | null = null
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const hasAnchor = <K = unknown, V = unknown>(
(isScalar(node) || isCollection(node)) && !!node.anchor

export abstract class NodeBase {
readonly [NODE_TYPE]: symbol
declare readonly [NODE_TYPE]: symbol

/** A comment on or immediately after this */
declare comment?: string | null
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/Pair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function createPair(
}

export class Pair<K = unknown, V = unknown> {
readonly [NODE_TYPE]: symbol
declare readonly [NODE_TYPE]: symbol

/** Always Node or null when parsed, but can be set to anything. */
key: K
Expand Down
6 changes: 3 additions & 3 deletions src/schema/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export class Schema {
toStringOptions: Readonly<ToStringOptions> | null;

// Used by createNode() and composeScalar()
[MAP]: CollectionTag;
[SCALAR]: ScalarTag;
[SEQ]: CollectionTag
declare readonly [MAP]: CollectionTag;
declare readonly [SCALAR]: ScalarTag;
declare readonly [SEQ]: CollectionTag

constructor({
compat,
Expand Down

0 comments on commit 7e9b489

Please sign in to comment.