Skip to content

quickmodel / IQSafeSerializedInterface

Type Alias: IQSafeSerializedInterface<T, TAliasMap, TSensitiveKeys> ​

IQSafeSerializedInterface<T, TAliasMap, TSensitiveKeys> = Omit<IQAliasedSerializedInterface<T, TAliasMap>, TSensitiveKeys>

Serialized interface with sensitive keys omitted.

This is the return type of serialize() / toJSON() / $qSerialize() when TSensitiveKeys is declared as the third generic argument of QModel<TInterface, TAliasMap, TSensitiveKeys>.

Fields listed in TSensitiveKeys are stripped at compile-time, which matches the runtime behaviour of @QSensitive (fields excluded unless { includeSensitive: true } is passed).

When TSensitiveKeys = never (the default), this type is identical to IQAliasedSerializedInterface<T, TAliasMap> — no overhead and no breaking change for models that do not declare sensitive keys.

Type Parameters ​

T ​

T

The model interface.

TAliasMap ​

TAliasMap extends Record<string, string> = Record<never, never>

Alias map from @Quick({ alias: ... }).

TSensitiveKeys ​

TSensitiveKeys extends keyof T = never

Union of property keys decorated with @QSensitive.

See ​