Revert "Fix TypeScript type errors across multiple files"
Some checks failed
Node.js CI / build (push) Has been cancelled

This reverts commit a3733b0424.
This commit is contained in:
Francis Cao 2026-02-16 16:20:04 -08:00
parent a3733b0424
commit 2260520ae5
12 changed files with 15 additions and 38 deletions

View file

@ -42,7 +42,7 @@ export function Funnel({ id, name, type, parameters, websiteId }) {
return (
<Dialog
title={formatMessage(labels.funnel)}
variant="sheet"
variant="modal"
style={{ minHeight: 300, minWidth: 400 }}
>
<FunnelEditForm id={id} websiteId={websiteId} onClose={close} />

View file

@ -16,7 +16,7 @@ export function FunnelAddButton({ websiteId }: { websiteId: string }) {
</Button>
<Modal>
<Dialog
variant="sheet"
variant="modal"
title={formatMessage(labels.funnel)}
style={{ minHeight: 375, minWidth: 600 }}
>

View file

@ -51,7 +51,7 @@ export function Goal({ id, name, type, parameters, websiteId, startDate, endDate
return (
<Dialog
title={formatMessage(labels.goal)}
variant="sheet"
variant="modal"
style={{ minHeight: 300, minWidth: 400 }}
>
<GoalEditForm id={id} websiteId={websiteId} onClose={close} />

View file

@ -22,11 +22,7 @@ export function WebsiteChart({
const chartData = useMemo(() => {
if (data) {
const result: {
pageviews: any[];
sessions: any[];
compare?: { pageviews: any[]; sessions: any[] };
} = {
const result = {
pageviews,
sessions,
};

View file

@ -10,7 +10,7 @@ import {
} from '@umami/react-zen';
import { Fragment } from 'react';
import { useMessages, useNavigation } from '@/components/hooks';
import { Edit, Ellipsis, Share } from '@/components/icons';
import { Edit, More, Share } from '@/components/icons';
export function WebsiteMenu({ websiteId }: { websiteId: string }) {
const { formatMessage, labels } = useMessages();
@ -33,7 +33,7 @@ export function WebsiteMenu({ websiteId }: { websiteId: string }) {
<MenuTrigger>
<Button variant="quiet">
<Icon>
<Ellipsis />
<More />
</Icon>
</Button>
<Popover placement="bottom">

View file

@ -13,7 +13,7 @@ interface UseMessages {
messages: typeof messages;
labels: typeof labels;
getMessage: (id: string) => string;
getErrorMessage: (error: string | Error | ApiError) => string | undefined;
getErrorMessage: (error: ApiError) => string | undefined;
FormattedMessage: typeof FormattedMessage;
}
@ -26,16 +26,12 @@ export function useMessages(): UseMessages {
return message ? formatMessage(message) : id;
};
const getErrorMessage = (error: string | Error | ApiError) => {
const getErrorMessage = (error: ApiError) => {
if (!error) {
return undefined;
}
if (typeof error === 'string') {
return error;
}
const code = (error as ApiError)?.code;
const code = error?.code;
return code ? getMessage(code) : error?.message || 'Unknown error';
};

View file

@ -19,7 +19,7 @@ export function LanguageButton() {
</Icon>
</Button>
<Popover placement="bottom end">
<Dialog variant="sheet">
<Dialog variant="menu">
<Grid columns="repeat(3, minmax(200px, 1fr))" overflow="hidden">
{items.map(({ value, label }) => {
return (

15
src/declaration.d.ts vendored
View file

@ -16,18 +16,3 @@ declare module 'semver';
declare module 'tsup';
declare module 'uuid';
declare module '@umami/esbuild-plugin-css-modules';
interface UmamiTracker {
track: {
(): Promise<string>;
(eventName: string): Promise<string>;
(eventName: string, obj: Record<string, any>): Promise<string>;
(properties: Record<string, any>): Promise<string>;
(eventFunction: (props: Record<string, any>) => Record<string, any>): Promise<string>;
};
identify: (data: Record<string, any>) => Promise<string>;
}
interface Window {
umami: UmamiTracker;
}

View file

@ -5,7 +5,7 @@ export const KAFKA = 'kafka';
export const KAFKA_PRODUCER = 'kafka-producer';
// Fixes issue with converting bigint values
(BigInt.prototype as any).toJSON = function () {
BigInt.prototype.toJSON = function () {
return Number(this);
};

View file

@ -10,7 +10,7 @@ import {
export function getFragmentChildren(children: ReactNode) {
return (children as ReactElement)?.type === Fragment
? (children as ReactElement<{ children: ReactNode }>).props.children
? (children as ReactElement).props.children
: children;
}

View file

@ -16,7 +16,7 @@ export async function parseRequest(
const url = new URL(request.url);
let query = Object.fromEntries(url.searchParams);
let body = await getJsonBody(request);
let error: (() => Response) | undefined;
let error: () => undefined | undefined;
let auth = null;
if (schema) {

View file

@ -60,7 +60,7 @@ async function relationalQuery(
endStepQuery: string;
params: Record<string, string>;
} {
const params: Record<string, string> = {};
const params = {};
let sequenceQuery = '';
let startStepQuery = '';
let endStepQuery = '';
@ -172,7 +172,7 @@ async function clickhouseQuery(
endStepQuery: string;
params: Record<string, string>;
} {
const params: Record<string, string> = {};
const params = {};
let sequenceQuery = '';
let startStepQuery = '';
let endStepQuery = '';