JSDoc, closes #5874

This commit is contained in:
Tom Moor
2023-09-23 14:31:55 -04:00
parent 3f11b014c5
commit 5c7c9ceeb1
15 changed files with 28 additions and 30 deletions

View File

@@ -2,17 +2,17 @@ import * as React from "react";
import { useMousePosition } from "~/hooks/useMousePosition";
type Positions = {
/* Sub-menu x */
/** Sub-menu x */
x: number;
/* Sub-menu y */
/** Sub-menu y */
y: number;
/* Sub-menu height */
/** Sub-menu height */
h: number;
/* Sub-menu width */
/** Sub-menu width */
w: number;
/* Mouse x */
/** Mouse x */
mouseX: number;
/* Mouse y */
/** Mouse y */
mouseY: number;
};

View File

@@ -21,9 +21,9 @@ const DELAY_OPEN = 500;
const DELAY_CLOSE = 600;
type Props = {
/* The HTML element that is being hovered over */
/** The HTML element that is being hovered over */
element: HTMLAnchorElement;
/* A callback on close of the hover preview */
/** A callback on close of the hover preview */
onClose: () => void;
};

View File

@@ -2,9 +2,9 @@ import * as React from "react";
import styled from "styled-components";
type Props = {
/* The emoji to render */
/** The emoji to render */
emoji: string;
/* The size of the emoji, 24px is default to match standard icons */
/** The size of the emoji, 24px is default to match standard icons */
size?: number;
};

View File

@@ -5,7 +5,7 @@ type Props = {
size?: number;
/** The color of the icon, defaults to the current text color */
color?: string;
/* Whether the safe area should be removed and have graphic across full size */
/** Whether the safe area should be removed and have graphic across full size */
cover?: boolean;
};

View File

@@ -121,7 +121,7 @@ export type Props = React.InputHTMLAttributes<
margin?: string | number;
error?: string;
icon?: React.ReactNode;
/* Callback is triggered with the CMD+Enter keyboard combo */
/** Callback is triggered with the CMD+Enter keyboard combo */
onRequestSubmit?: (
ev: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>
) => unknown;

View File

@@ -1,7 +1,7 @@
import styled from "styled-components";
type Props = {
/* Set to true if displaying a single symbol character to disable monospace */
/** Set to true if displaying a single symbol character to disable monospace */
symbol?: boolean;
};

View File

@@ -22,7 +22,7 @@ import Tooltip from "../Tooltip";
import NotificationListItem from "./NotificationListItem";
type Props = {
/* Callback when the notification panel wants to close. */
/** Callback when the notification panel wants to close. */
onRequestClose: () => void;
};

View File

@@ -22,7 +22,7 @@ type Props = Omit<NavLinkProps, "to"> & {
to?: LocationDescriptor;
innerRef?: (ref: HTMLElement | null | undefined) => void;
onClick?: React.MouseEventHandler<HTMLAnchorElement>;
/* Callback when we expect the user to click on the link. Used for prefetching data. */
/** Callback when we expect the user to click on the link. Used for prefetching data. */
onClickIntent?: () => void;
onDisclosureClick?: React.MouseEventHandler<HTMLButtonElement>;
icon?: React.ReactNode;
@@ -32,7 +32,7 @@ type Props = Omit<NavLinkProps, "to"> & {
showActions?: boolean;
disabled?: boolean;
active?: boolean;
/* If set, a disclosure will be rendered to the left of any icon */
/** If set, a disclosure will be rendered to the left of any icon */
expanded?: boolean;
isActiveDrop?: boolean;
isDraft?: boolean;

View File

@@ -14,9 +14,9 @@ import {
} from "../errors";
type AuthenticationOptions = {
/* An admin user role is required to access the route */
/** An admin user role is required to access the route */
admin?: boolean;
/* A member or admin user role is required to access the route */
/** A member or admin user role is required to access the route */
member?: boolean;
/**
* Authentication is parsed, but optional. Note that if a token is provided

View File

@@ -19,7 +19,6 @@ describe("CleanupExpiredFileOperationsTask", () => {
state: FileOperationState.Complete,
});
/* This is a test helper that creates a new task and runs it. */
const task = new CleanupExpiredFileOperationsTask();
await task.perform({ limit: 100 });

View File

@@ -19,7 +19,6 @@ describe("ErrorTimedOutFileOperationsTask", () => {
state: FileOperationState.Complete,
});
/* This is a test helper that creates a new task and runs it. */
const task = new ErrorTimedOutFileOperationsTask();
await task.perform({ limit: 100 });

View File

@@ -4,9 +4,9 @@ import FileStorage from "@server/storage/files";
import BaseTask, { TaskPriority } from "./BaseTask";
type Props = {
/* The teamId to operate on */
/** The teamId to operate on */
teamId: string;
/* The original avatarUrl from the SSO provider */
/** The original avatarUrl from the SSO provider */
avatarUrl: string;
};

View File

@@ -4,9 +4,9 @@ import FileStorage from "@server/storage/files";
import BaseTask, { TaskPriority } from "./BaseTask";
type Props = {
/* The userId to operate on */
/** The userId to operate on */
userId: string;
/* The original avatarUrl from the SSO provider */
/** The original avatarUrl from the SSO provider */
avatarUrl: string;
};

View File

@@ -391,15 +391,15 @@ export type NotificationMetadata = {
};
export type JSONExportMetadata = {
/* The version of the export, allows updated structure in the future. */
/** The version of the export, allows updated structure in the future. */
exportVersion: number;
/* The version of the application that created the export. */
/** The version of the application that created the export. */
version: string;
/* The date the export was created. */
/** The date the export was created. */
createdAt: string;
/* The ID of the user that created the export. */
/** The ID of the user that created the export. */
createdById: string;
/* The email of the user that created the export. */
/** The email of the user that created the export. */
createdByEmail: string | null;
};

View File

@@ -3,7 +3,7 @@ import env from "@server/env";
import OAuthClient from "./oauth";
type AzurePayload = {
/* A GUID that represents the Azure AD tenant that the user is from */
/** A GUID that represents the Azure AD tenant that the user is from */
tid: string;
};