samchon / nestia-helper

NestJS helper with Type level
MIT License
34 stars 3 forks source link

Follow change of the `IEncryptionPassword.Closure` #8

Closed samchon closed 2 years ago

samchon commented 2 years ago

https://github.com/samchon/nestia-fetcher/issues/3

The IEncryptionPassword.Closure parameter has been changed from content body (string type) to IEncryptionPassword.IParameter.

export namespace IEncryptionPassword
{
    /**
     * Type of a closure function returning the {@link IEncryptionPassword} object.
     * 
     * `IEncryptionPassword.Closure` is a type of closure function who are returning the
     * {@link IEncryptionPassword} object. It would be used when your encryption password
     * be changed according to the input content.
     */
    export interface Closure
    {
        /**
         * Encryption password getter.
         * 
         * @param param Request or response headers and body content
         * @param encoded Be encoded or to be decoded
         * @returns Encryption password
         */
        (param: IParameter, encoded: boolean): IEncryptionPassword;
    }

    /**
     * Parameter for the closure.
     */
    export interface IParameter
    {
        headers: Record<string, string>;
        body: string;
    }
}