bona
Version:
Super lightweight microframework focused on static websites and landing pages.
36 lines • 998 B
TypeScript
/**
* @typedef {Object} BonaEventOptions
* @property {boolean} [once] Trigger callback once.
*/
export default class Base {
_events: {};
/**
* Attach an event handler function.
*
* @param {string} event Event name.
* @param {function} callback Callback.
* @param {BonaEventOptions} [options] Options.
*/
on(event: string, callback: Function, options?: BonaEventOptions): void;
/**
* Remove an event handler.
*
* @param {string} event Event name.
* @param {function} [callback] Callback.
*/
off(event: string, callback?: Function): void;
/**
* Execute all handlers for the given event type.
*
* @param {string} event Event name.
* @param params Extra parameters.
*/
trigger(event: string, ...params: any[]): void;
}
export type BonaEventOptions = {
/**
* Trigger callback once.
*/
once?: boolean;
};
//# sourceMappingURL=index.d.ts.map