fix type errors

This commit is contained in:
thislight 2025-01-04 17:10:54 +08:00
parent 99efa6b42c
commit 203eeb9761
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E
7 changed files with 7 additions and 7 deletions

View file

@ -51,7 +51,7 @@ function animateSlideInFromBottom(element: HTMLElement, reverse?: boolean) {
} }
const BottomSheet: ParentComponent<BottomSheetProps> = (props) => { const BottomSheet: ParentComponent<BottomSheetProps> = (props) => {
let element: HTMLDialogElement; let element!: HTMLDialogElement;
let animation: Animation | undefined; let animation: Animation | undefined;
const child = children(() => props.children); const child = children(() => props.children);

View file

@ -108,7 +108,7 @@ function animateGrowFromTopLeft(
* - Use {@link MenuItem} from SUID as children. * - Use {@link MenuItem} from SUID as children.
*/ */
const Menu: Component<MenuProps> = (oprops) => { const Menu: Component<MenuProps> = (oprops) => {
let root: HTMLDialogElement; let root!: HTMLDialogElement;
const windowSize = useWindowSize(); const windowSize = useWindowSize();
const [props, rest] = splitProps(oprops, [ const [props, rest] = splitProps(oprops, [
"open", "open",

View file

@ -38,7 +38,7 @@ function clamp(input: number, min: number, max: number) {
} }
const MediaViewer: ParentComponent<MediaViewerProps> = (props) => { const MediaViewer: ParentComponent<MediaViewerProps> = (props) => {
let rootRef: HTMLDialogElement; let rootRef!: HTMLDialogElement;
type State = { type State = {
ref?: HTMLElement; ref?: HTMLElement;

View file

@ -17,7 +17,7 @@ const PullDownToRefresh: Component<{
linkedElement?: HTMLElement; linkedElement?: HTMLElement;
onRefresh?: () => void; onRefresh?: () => void;
}> = (props) => { }> = (props) => {
let rootElement: HTMLDivElement; let rootElement!: HTMLDivElement;
const [pullDown, setPullDown] = createSignal(0); const [pullDown, setPullDown] = createSignal(0);
const stopPos = () => 160; const stopPos = () => 160;

View file

@ -23,7 +23,7 @@ type ChooseTootLangProps = {
}; };
const ChooseTootLang: Component<ChooseTootLangProps> = (props) => { const ChooseTootLang: Component<ChooseTootLangProps> = (props) => {
let listRef: HTMLUListElement; let listRef!: HTMLUListElement;
const [t] = createTranslator( const [t] = createTranslator(
(code) => (code) =>
import(`./i18n/${code}.json`) as Promise<{ import(`./i18n/${code}.json`) as Promise<{

View file

@ -17,7 +17,7 @@ export function PreviewCard(props: {
src: mastodon.v1.PreviewCard; src: mastodon.v1.PreviewCard;
alwaysCompact?: boolean; alwaysCompact?: boolean;
}) { }) {
let root: HTMLAnchorElement; let root!: HTMLAnchorElement;
createEffect(() => { createEffect(() => {
if (props.alwaysCompact) { if (props.alwaysCompact) {

View file

@ -33,7 +33,7 @@ type TootPollProps = {
}; };
const TootPoll: Component<TootPollProps> = (props) => { const TootPoll: Component<TootPollProps> = (props) => {
let list: HTMLUListElement; let list!: HTMLUListElement;
const { vote } = useTootEnv(); const { vote } = useTootEnv();
const now = useTimeSource(); const now = useTimeSource();