next-mdx-remote-client
Version:
A wrapper of the `@mdx-js/mdx` for the `nextjs` applications in order to load MDX content. It is a fork of `next-mdx-remote`.
29 lines (24 loc) • 748 B
TypeScript
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*
* reference to https://github.com/hashicorp/next-mdx-remote/blob/main/src/index.tsx
* requestIdleCallback types found here: https://github.com/microsoft/TypeScript/issues/21309
*/
type RequestIdleCallbackHandle = number;
type RequestIdleCallbackOptions = {
timeout?: number;
};
type RequestIdleCallbackDeadline = {
readonly didTimeout: boolean;
timeRemaining: () => number;
};
declare global {
interface Window {
requestIdleCallback: (
callback: (deadline: RequestIdleCallbackDeadline) => void,
opts?: RequestIdleCallbackOptions,
) => RequestIdleCallbackHandle;
cancelIdleCallback: (handle: RequestIdleCallbackHandle) => void;
}
}