Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update index.d.ts #44

Merged
merged 2 commits into from
Oct 13, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {NextConfig} from 'next';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import {NextConfig} from 'next';
import type {NextConfig} from 'next';

import type {ElementType} from 'react';
import type {Config, RenderableTreeNodes, Schema} from '@markdoc/markdoc';
import type {RuleSetConditionAbsolute} from 'webpack';

export type MarkdocNextJsPageProps = {
markdoc?: {
Expand All @@ -17,3 +19,19 @@ export type MarkdocNextJsSchema<O extends Object = {}> = Schema<
O & MarkdocNextJsConfig,
ElementType
>;

export interface MarkdocNextJsOptions {
extension?: RuleSetConditionAbsolute;
mode?: 'static' | 'server';
options?: {
slots?: boolean;
allowComments?: boolean;
};
schemaPath?: string;
}

declare function createMarkdocPlugin(
options?: MarkdocNextJsOptions
): (config: NextConfig) => NextConfig;

export = createMarkdocPlugin;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm ts says: "TS2309: An export assignment cannot be used in a module with other exported elements."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it does seem to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try export default instead

Loading