From 61ee4d06ec7ead14cf8224b337098b2648e4885b Mon Sep 17 00:00:00 2001 From: Junxiao Shi Date: Sun, 26 Jan 2025 15:49:12 +0000 Subject: [PATCH] set: mark unchanged parameters as `ReadonlySet` --- CHANGELOG.md | 1 + set.d.ts | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a39213e4..2d13f0b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Fixing `Set` operations CommonJS named export collision by renaming it to `set` (@jerome-benoit). * Fixing missing `Uint8Vector`, `Uint8ClampedVector`, `Int8Vector`, `Uint16Vector`, `Int16Vector`, `Uint32Vector`, `Int32Vector`, `Float32Vector`, `Float64Vector`, `PointerVector` CommonJS named exports (@jerome-benoit). * Fixing missing `PointerVector` TS exports (@jerome-benoit). +* Marking unchanged parameters as `ReadonlySet` in `set` operations (@yoursunny). ## 0.39.8 diff --git a/set.d.ts b/set.d.ts index 4fabdedc..d7b97208 100644 --- a/set.d.ts +++ b/set.d.ts @@ -2,17 +2,17 @@ * Mnemonist Set Typings * ====================== */ -export function intersection(...set: Array>): Set; -export function union(...set: Array>): Set; -export function difference(a: Set, b: Set): Set; -export function symmetricDifference(a: Set, b: Set): Set; -export function isSubset(a: Set, b: Set): boolean; -export function isSuperset(a: Set, b: Set): boolean; -export function add(a: Set, b: Set): void; -export function subtract(a: Set, b: Set): void; -export function intersect(a: Set, b: Set): void; -export function disjunct(a: Set, b: Set): void; -export function intersectionSize(a: Set, b: Set): number; -export function unionSize(a: Set, b: Set): number; -export function jaccard(a: Set, b: Set): number; -export function overlap(a: Set, b: Set): number; +export function intersection(a: ReadonlySet, b: ReadonlySet, ...rest: Array>): Set; +export function union(a: ReadonlySet, b: ReadonlySet, ...rest: Array>): Set; +export function difference(a: ReadonlySet, b: ReadonlySet): Set; +export function symmetricDifference(a: ReadonlySet, b: ReadonlySet): Set; +export function isSubset(a: ReadonlySet, b: ReadonlySet): boolean; +export function isSuperset(a: ReadonlySet, b: ReadonlySet): boolean; +export function add(a: Set, b: ReadonlySet): void; +export function subtract(a: Set, b: ReadonlySet): void; +export function intersect(a: Set, b: ReadonlySet): void; +export function disjunct(a: Set, b: ReadonlySet): void; +export function intersectionSize(a: ReadonlySet, b: ReadonlySet): number; +export function unionSize(a: ReadonlySet, b: ReadonlySet): number; +export function jaccard(a: ReadonlySet, b: ReadonlySet): number; +export function overlap(a: ReadonlySet, b: ReadonlySet): number;