diff --git a/src/mol-model/loci.ts b/src/mol-model/loci.ts index b3771c937c43dc87883f66196f5ddc23e4df2fbd..97e28b0bc1e2afef9ecd604b20d1adc591f355bc 100644 --- a/src/mol-model/loci.ts +++ b/src/mol-model/loci.ts @@ -32,9 +32,9 @@ export function isEmptyLoci(x?: Loci): x is EmptyLoci { } /** A generic data loci */ -export interface DataLoci { +export interface DataLoci<T = unknown> { readonly kind: 'data-loci', - readonly data: any, + readonly data: T, readonly tag: string readonly indices: OrderedSet<number> } @@ -47,7 +47,7 @@ export function areDataLociEqual(a: DataLoci, b: DataLoci) { export function isDataLociEmpty(loci: DataLoci) { return OrderedSet.size(loci.indices) === 0 ? true : false } -export function createDataLoci(data: any, tag: string, indices: OrderedSet<number>): DataLoci { +export function createDataLoci<T = unknown>(data: T, tag: string, indices: OrderedSet<number>): DataLoci<T> { return { kind: 'data-loci', data, tag, indices } }