Skip to content

Commit

Permalink
💚 ci: ci ts error fixed (#104)
Browse files Browse the repository at this point in the history
* 💚 fix: ci ts error fixed

* 💚 fix: delete useless types tsconfig
  • Loading branch information
ONLY-yours authored Nov 24, 2023
1 parent 96b3938 commit 2d5a006
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/Markdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import remarkGfm from 'remark-gfm';
import remarkMath from 'remark-math';

import { HighlightProps, SnippetProps } from '@ant-design/pro-editor';
import { PluggableList } from 'react-markdown/lib/react-markdown';
import { Code } from './CodeBlock';
import { useStyles } from './style';

Expand Down Expand Up @@ -47,7 +48,7 @@ const Markdown = memo<MarkdownProps>(
<ReactMarkdown
className={styles.markdown}
components={components}
rehypePlugins={[rehypeKatex]}
rehypePlugins={[rehypeKatex] as PluggableList}
remarkPlugins={[remarkGfm, remarkMath]}
{...rest}
>
Expand Down
5 changes: 4 additions & 1 deletion src/ProBuilder/store/slices/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ export const configSlice: StateCreator<
replace,
);

const useAction = merge({}, { recordHistory: true }, { recordHistory });
const useAction: {
recordHistory: boolean;
payload?: Partial<UserActionParams>;
} = merge({}, { recordHistory: true }, { recordHistory });

if (useAction.recordHistory) {
get().yjsDoc.recordHistoryData({ config }, { ...useAction.payload, timestamp: Date.now() });
Expand Down
6 changes: 3 additions & 3 deletions src/ProBuilder/utils/yjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Doc, UndoManager } from 'yjs';
import { DocOpts } from 'yjs/dist/src/utils/Doc';

export interface UserActionParams {
type: string;
name: string;
timestamp: number;
type?: string;
name?: string;
timestamp?: number;
}

class UserAction {
Expand Down
2 changes: 0 additions & 2 deletions src/ProEditor/ProEditorProvider/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ProEditorProvider, proEditorMiddleware } from '@ant-design/pro-editor';

import { render, renderHook, screen } from '@testing-library/react';
import { create } from 'zustand';

Expand All @@ -22,7 +21,6 @@ describe('ProEditorProvider', () => {
<div>Child Component</div>
</ProEditorProvider>,
);

expect(screen.getByText('Child Component')).toBeInTheDocument();
});

Expand Down
2 changes: 1 addition & 1 deletion src/ProEditor/store/slices/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface ActionOptions {
recordHistory?: boolean;
replace?: boolean;
trigger?: string;
type?: unknown;
type?: unknown | string;
name?: string;
}

Expand Down
6 changes: 3 additions & 3 deletions src/ProEditor/utils/yjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { StackItem } from 'yjs/dist/src/utils/UndoManager';
import { YEvent } from 'yjs/dist/src/utils/YEvent';

export interface UserActionParams {
type: string;
name: string;
timestamp: number;
type?: string | unknown;
name?: string;
timestamp?: number;
}

class UserAction {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"target": "ESNext",
"module": "esnext",
"jsx": "react-jsx",
"types": ["vitest/globals"],
"types": ["vitest/globals", "@testing-library/jest-dom"],
"declaration": true,
"baseUrl": ".",
"paths": {
Expand Down

0 comments on commit 2d5a006

Please sign in to comment.