@lightningkite/ktor-batteries
Version:
30 lines (27 loc) • 1.33 kB
text/typescript
// Package: com.lightningkite.ktordb
// Generated by Khrysalis - this file will be overwritten.
import { ReifiedType, setUpDataClass } from '@lightningkite/khrysalis-runtime'
//! Declares com.lightningkite.ktordb.EntryChange
export class EntryChange<T extends any> {
public constructor(public readonly old: (T | null) = null, public readonly _new: (T | null) = null) {
}
public static properties = ["old", "_new"]
public static propertiesJsonOverride = {_new: "new"}
public static propertyTypes(T: ReifiedType) { return {old: T, _new: T} }
copy: (values: Partial<EntryChange<T>>) => this;
equals: (other: any) => boolean;
hashCode: () => number;
}
setUpDataClass(EntryChange)
//! Declares com.lightningkite.ktordb.map>com.lightningkite.ktordb.EntryChangecom.lightningkite.ktordb.map.T
export function xEntryChangeMap<T extends any, B extends any>(this_: EntryChange<T>, mapper: ((a: T) => B)): EntryChange<B> {
return new EntryChange<B>(((): (B | null) => {
const temp0 = this_.old;
if(temp0 === null) { return null }
return (mapper)(temp0)
})(), ((): (B | null) => {
const temp1 = this_._new;
if(temp1 === null) { return null }
return (mapper)(temp1)
})());
}