@uiowa/uiowa-mfk
Version:
mfk, uiowa-mfk, uiowa-favorite-mfk, mfk-string
33 lines (32 loc) • 991 B
TypeScript
import { Mfk } from './mfk';
/**
* checks the equality of two Mfk objects
* @param mfk1 an Mfk object
* @param mfk2 an Mfk object
*/
export declare function areEqual(mfk1: Mfk, mfk2: Mfk): boolean;
/**
* converts an Mfk object to a string by joining 10 fields with '-' symbol.
* @param mfk An Mfk object
*/
export declare function stringify(mfk: Mfk | null): string;
/**
* creates an empty Mfk object with all 10 fields being empty string
*/
export declare function emptyMfk(): Mfk;
/**
* checks if an Mfk object is in a valid format
*/
export declare function validFormat(mfk: Mfk): boolean;
/**
* checks if each field of an Mfk object is in a valid format
* returns an array of error messages
* If the format is valid, then the returning array is empty.
*/
export declare function validateStructure(mfk: Mfk): string[];
/**
* Convert a string to an MFK object
* @param mfkString MFK string
* @returns MFK object
*/
export declare function toMfk(mfkString: string): Mfk;