17 expirationDate: Date;
18}
19
20export const InviteCreateModal = createModal<void>(({ actions }) => {21 const tInvite = useScopedI18n("management.page.user.invite");
22 const t = useI18n();
23 const { openModal } = useModalAction(InviteCopyModal);
28 );
29};
30
31const AddGroupModal = createModal<void>(({ actions }) => {32 const t = useI18n();
33 const { mutate, isPending } = clientApi.group.createGroup.useMutation();
34 const form = useZodForm(validation.group.create, {
56 * Otherwise it will return void (as type).
57 */
58export const checkCron = <const T extends string>(cron: T) => {
59 return cron as ValidateCron<T> extends true ? T : void;60};
9
10import { useItemActions } from "./item-actions";
11
12export const ItemSelectModal = createModal<void>(({ actions }) => {13 return (
14 <Grid>
15 {objectEntries(widgetImports).map(([key, value]) => {
137 if (!context) throw new Error("ModalContext is not provided");
138
139 return {
140 openModal: (innerProps: inferInnerProps<TModal>, options: OpenModalOptions | void) => {141 // void actually is undefined
142 // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
143 context.openModalInner({ modal, innerProps, options: options ?? {} });
Disallows usage of void type outside of return types or generic type arguments. If void is used as return type, it shouldn’t be a part of intersection/union type with most other types.
type PossibleValues = string | number | void;
type MorePossibleValues = string | ((number & any) | (string | void));
function logSomething(thing: void) {}
function printArg<T = void>(arg: T) {}
logAndReturn<void>(undefined);
interface Interface {
lambda: () => void;
prop: void;
}
class MyClass {
private readonly propName: void;
}
type NoOp = () => void;
function noop(): void {}
let trulyUndefined = void 0;
async function promiseMeSomething(): Promise<void> {}
type stillVoid = void | never;