build
This commit is contained in:
parent
214c18fae0
commit
9aa36bcba9
7 changed files with 271 additions and 303 deletions
|
|
@ -39,80 +39,24 @@ type tipoPrErroInterno = {
|
|||
*
|
||||
* @param registrarErroInterno callback para registrar/normalizar erros internos.
|
||||
*/
|
||||
interface InterfaceRespostas {
|
||||
valor: <T>(valor: T, detalhes?: string[]) => tipoRespostaSucesso<T>;
|
||||
valorTrue: (detalhes?: string[]) => tipoRespostaSucesso<true>;
|
||||
erro: (mensagem: string, detalhes?: string[]) => tipoRespostaErro;
|
||||
erroPermissao: (mensagem?: string | undefined | null, detalhes?: string[]) => tipoRespostaErro;
|
||||
erroInterno: (op: tipoPrErroInterno) => tipoRespostaErro;
|
||||
naoEncontrado: (mensagem?: string | undefined | null, detalhes?: string[]) => tipoRespostaErro;
|
||||
tempoEsgotado: (mensagem?: string | undefined | null, detalhes?: string[]) => tipoRespostaErro;
|
||||
erroEspera: (mensagem?: string | undefined | null, detalhes?: string[]) => tipoRespostaErro;
|
||||
}
|
||||
declare const gerarRespostas: (
|
||||
/** Faz um processamento quando erro interno
|
||||
* Recebe o erro gerado, mensagem personalizada e detalhes
|
||||
*/
|
||||
registrarErroInterno: (op: tipoPrErroInterno) => Partial<tipoRespostaErro>) => {
|
||||
/**
|
||||
* Gera uma resposta de sucesso
|
||||
*/
|
||||
valor: <T>(valor: T, detalhes?: string[]) => tipoRespostaSucesso<T>;
|
||||
/**
|
||||
* Gera uma resposta de sucesso com valor true
|
||||
*/
|
||||
valorTrue: (detalhes?: string[]) => tipoRespostaSucesso<true>;
|
||||
/**
|
||||
* Gera uma resposta de erro conhecido
|
||||
*/
|
||||
erro: (mensagem: string, detalhes?: string[]) => tipoRespostaErro;
|
||||
/**
|
||||
* Gera uma resposta de erro de permissão,será necessário fazer o login novamente
|
||||
*/
|
||||
erroPermissao: (mensagem?: string | undefined | null, detalhes?: string[]) => tipoRespostaErro;
|
||||
/**
|
||||
* Gera uma resposta de erro desconhecido, geralmente tem origem de um exception
|
||||
*/
|
||||
erroInterno: (op: tipoPrErroInterno) => tipoRespostaErro;
|
||||
/**
|
||||
* Gera uma resposta de erro quando um registro não é encontrado ou sua execução depende de um registro existente
|
||||
*/
|
||||
naoEncontrado: (mensagem?: string | undefined | null, detalhes?: string[]) => tipoRespostaErro;
|
||||
/**
|
||||
* Gera uma resposta de erro quando o tempo de resposta é esgotado
|
||||
*/
|
||||
tempoEsgotado: (mensagem?: string | undefined | null, detalhes?: string[]) => tipoRespostaErro;
|
||||
/**
|
||||
* Gera uma resposta de erro quando o tempo de resposta é esgotado
|
||||
*/
|
||||
erroEspera: (mensagem?: string | undefined | null, detalhes?: string[]) => tipoRespostaErro;
|
||||
};
|
||||
registrarErroInterno: (op: tipoPrErroInterno) => Partial<tipoRespostaErro>) => InterfaceRespostas;
|
||||
/**
|
||||
* Instância default (sem handler de erro interno).
|
||||
*/
|
||||
declare const respostaComuns: {
|
||||
/**
|
||||
* Gera uma resposta de sucesso
|
||||
*/
|
||||
valor: <T>(valor: T, detalhes?: string[]) => tipoRespostaSucesso<T>;
|
||||
/**
|
||||
* Gera uma resposta de sucesso com valor true
|
||||
*/
|
||||
valorTrue: (detalhes?: string[]) => tipoRespostaSucesso<true>;
|
||||
/**
|
||||
* Gera uma resposta de erro conhecido
|
||||
*/
|
||||
erro: (mensagem: string, detalhes?: string[]) => tipoRespostaErro;
|
||||
/**
|
||||
* Gera uma resposta de erro de permissão,será necessário fazer o login novamente
|
||||
*/
|
||||
erroPermissao: (mensagem?: string | undefined | null, detalhes?: string[]) => tipoRespostaErro;
|
||||
/**
|
||||
* Gera uma resposta de erro desconhecido, geralmente tem origem de um exception
|
||||
*/
|
||||
erroInterno: (op: tipoPrErroInterno) => tipoRespostaErro;
|
||||
/**
|
||||
* Gera uma resposta de erro quando um registro não é encontrado ou sua execução depende de um registro existente
|
||||
*/
|
||||
naoEncontrado: (mensagem?: string | undefined | null, detalhes?: string[]) => tipoRespostaErro;
|
||||
/**
|
||||
* Gera uma resposta de erro quando o tempo de resposta é esgotado
|
||||
*/
|
||||
tempoEsgotado: (mensagem?: string | undefined | null, detalhes?: string[]) => tipoRespostaErro;
|
||||
/**
|
||||
* Gera uma resposta de erro quando o tempo de resposta é esgotado
|
||||
*/
|
||||
erroEspera: (mensagem?: string | undefined | null, detalhes?: string[]) => tipoRespostaErro;
|
||||
};
|
||||
declare const respostaComuns: InterfaceRespostas;
|
||||
|
||||
export { codigosResposta, gerarRespostas, respostaComuns, type tipoPrErroInterno, type tipoResposta, type tipoRespostaErro, type tipoRespostaSucesso };
|
||||
export { type InterfaceRespostas, codigosResposta, gerarRespostas, respostaComuns, type tipoPrErroInterno, type tipoResposta, type tipoRespostaErro, type tipoRespostaSucesso };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue