2023-05-23 19:17:28 +00:00
|
|
|
import { UrlTweaks } from 'app/common/gristUrls';
|
2023-09-09 18:50:32 +00:00
|
|
|
import { IAttrObj } from 'grainjs';
|
2023-05-23 19:17:28 +00:00
|
|
|
|
|
|
|
export interface IHooks {
|
|
|
|
iframeAttributes?: Record<string, any>,
|
|
|
|
fetch?: typeof fetch,
|
|
|
|
baseURI?: string,
|
|
|
|
urlTweaks?: UrlTweaks,
|
2023-09-09 18:50:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Modify the attributes of an <a> dom element.
|
|
|
|
* Convenient in grist-static to directly hook up a
|
|
|
|
* download link with the function that provides the data.
|
|
|
|
*/
|
|
|
|
maybeModifyLinkAttrs(attrs: IAttrObj): IAttrObj;
|
2023-05-23 19:17:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const defaultHooks: IHooks = {
|
2023-09-09 18:50:32 +00:00
|
|
|
maybeModifyLinkAttrs(attrs: IAttrObj) {
|
|
|
|
return attrs;
|
|
|
|
}
|
2023-05-23 19:17:28 +00:00
|
|
|
};
|