PHP WebShell
Текущая директория: /opt/BitGoJS/node_modules/@aptos-labs/ts-sdk/dist/esm/core
Просмотр файла: common.d.mts
/**
* This error is used to explain why parsing failed.
*/
declare class ParsingError<T> extends Error {
/**
* This provides a programmatic way to access why parsing failed. Downstream devs
* might want to use this to build their own error messages if the default error
* messages are not suitable for their use case. This should be an enum.
*/
invalidReason: T;
/**
* Creates an instance of the error with a specified message and invalid reason.
*
* @param message The error message that describes the issue.
* @param invalidReason The reason why the input is considered invalid.
*/
constructor(message: string, invalidReason: T);
}
/**
* Whereas ParsingError is thrown when parsing fails, e.g. in a fromString function,
* this type is returned from "defensive" functions like isValid.
*/
type ParsingResult<T> = {
/**
* True if valid, false otherwise.
*/
valid: boolean;
/**
* If valid is false, this will be a code explaining why parsing failed.
*/
invalidReason?: T;
/**
* If valid is false, this will be a string explaining why parsing failed.
*/
invalidReasonMessage?: string;
};
export { ParsingError, type ParsingResult };
Выполнить команду
Для локальной разработки. Не используйте в интернете!