activitypress/module.d.ts

23 lines
677 B
TypeScript
Raw Normal View History

2023-12-25 18:49:16 +00:00
declare module "activitypub-express" {
function ActivitypubExpress(options: Record<string, any>);
export default ActivitypubExpress;
2023-12-26 02:33:18 +00:00
}
2023-12-27 14:18:26 +00:00
// Only enough here for what I need.
2023-12-26 02:33:18 +00:00
declare module "activitypub-http-signatures" {
export class Sha256Signer {
2023-12-31 10:36:13 +00:00
constructor(options: { publicKeyId: string, privateKey: string, headerNames?: string[] });
2023-12-26 02:33:18 +00:00
2023-12-31 12:31:58 +00:00
sign: (options: { url: string, method: string, headers: HeadersInit }) => string;
2023-12-26 02:33:18 +00:00
};
2023-12-27 14:18:26 +00:00
2023-12-27 14:42:48 +00:00
type parse = (params: { url: string, method: string, headers: Record<string, string> }) => {
2023-12-27 14:18:26 +00:00
verify: (publicKey: string) => boolean;
};
2023-12-27 14:42:48 +00:00
export default {
Sha256Signer,
parse
};
2023-12-26 02:33:18 +00:00
}