Skip to content

Commit

Permalink
Don't use ambient types
Browse files Browse the repository at this point in the history
  • Loading branch information
elektronaut committed May 14, 2024
1 parent c6a7fb6 commit a18d7f5
Show file tree
Hide file tree
Showing 74 changed files with 681 additions and 543 deletions.
2 changes: 1 addition & 1 deletion app/assets/builds/pages_core/admin-dist.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions app/assets/builds/pages_core/admin-dist.js.map

Large diffs are not rendered by default.

14 changes: 0 additions & 14 deletions app/javascript/@types/Attachments.d.ts

This file was deleted.

36 changes: 0 additions & 36 deletions app/javascript/@types/Crop.d.ts

This file was deleted.

36 changes: 0 additions & 36 deletions app/javascript/@types/Drag.d.ts

This file was deleted.

17 changes: 0 additions & 17 deletions app/javascript/@types/ImageGrid.d.ts

This file was deleted.

72 changes: 0 additions & 72 deletions app/javascript/@types/Page.d.ts

This file was deleted.

24 changes: 0 additions & 24 deletions app/javascript/@types/PageForm.d.ts

This file was deleted.

11 changes: 0 additions & 11 deletions app/javascript/@types/TagEditor.d.ts

This file was deleted.

26 changes: 0 additions & 26 deletions app/javascript/@types/Template.d.ts

This file was deleted.

21 changes: 0 additions & 21 deletions app/javascript/@types/Tree.d.ts

This file was deleted.

52 changes: 0 additions & 52 deletions app/javascript/@types/index.d.ts

This file was deleted.

5 changes: 3 additions & 2 deletions app/javascript/components/Attachments.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from "react";
import useAttachments from "./Attachments/useAttachments";
import List from "./Attachments/List";
import * as Attachment from "../types/Attachments";

interface Props extends Attachments.Options {
records: AttachmentRecord[];
interface Props extends Attachment.Options {
records: Attachment.Record[];
}

export default function Attachments(props: Props) {
Expand Down
14 changes: 10 additions & 4 deletions app/javascript/components/Attachments/Attachment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@ import copyToClipboard from "../../lib/copyToClipboard";
import AttachmentEditor from "./AttachmentEditor";
import useModalStore from "../../stores/useModalStore";
import useToastStore from "../../stores/useToastStore";
import * as Attachments from "../../types/Attachments";
import * as Drag from "../../types/Drag";
import { Locale } from "../../types";

import { useDraggable } from "../drag";

interface Props {
attributeName: string;
placeholder: boolean;
draggable: Drag.Draggable<AttachmentRecord>;
draggable: Drag.Draggable<Attachments.Record>;
locale: string;
locales: { [index: string]: Locale };
deleteRecord: () => void;
showEmbed: boolean;
position: number;
onUpdate: (attachment: Partial<AttachmentResource>) => void;
onUpdate: (attachment: Partial<Attachments.Resource>) => void;
startDrag: (
evt: MouseEvent,
draggable: Drag.Draggable<AttachmentRecord>
draggable: Drag.Draggable<Attachments.Record>
) => void;
}

Expand All @@ -30,7 +33,10 @@ export default function Attachment(props: Props) {
const openModal = useModalStore((state) => state.open);
const notice = useToastStore((state) => state.notice);

const listeners = useDraggable<AttachmentRecord>(draggable, props.startDrag);
const listeners = useDraggable<Attachments.Record>(
draggable,
props.startDrag
);

const copyEmbed = (evt: MouseEvent) => {
evt.preventDefault();
Expand Down
6 changes: 4 additions & 2 deletions app/javascript/components/Attachments/AttachmentEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import copyToClipboard, { copySupported } from "../../lib/copyToClipboard";
import useModalStore from "../../stores/useModalStore";
import useToastStore from "../../stores/useToastStore";
import { putJson } from "../../lib/request";
import * as Attachments from "../../types/Attachments";
import { Locale } from "../../types";

interface Props {
attachment: AttachmentResource;
attachment: Attachments.Resource;
locale: string;
locales: { [index: string]: Locale };
onUpdate: (attachment: Partial<AttachmentResource>) => void;
onUpdate: (attachment: Partial<Attachments.Resource>) => void;
}

export default function AttachmentEditor(props: Props) {
Expand Down
Loading

0 comments on commit a18d7f5

Please sign in to comment.