-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.ts
More file actions
33 lines (25 loc) · 858 Bytes
/
types.ts
File metadata and controls
33 lines (25 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import type { Component } from 'svelte';
export type Demand<T> = {
[K in keyof T]-?: {} extends { [P in K]: T[K] } ? never : K;
}[keyof T] extends [never]
? [T?]
: [T];
export interface LazyComponent<T extends Component<any, any>> {
(): Promise<{ default: T }>;
}
// ---- Syv ----
export interface SyvOptions {
'syv:anchor'?: Element | Document;
'syv:intro'?: boolean;
}
type CSSValue = false | number | 'none' | SyvCSS.GlobalValues;
export type SyvStyles<T extends string> = Record<string, CSSValue> & {
[K in T as `--${K}`]?: CSSValue;
};
// ---- CSS ----
type Flexible<Union extends T, T = string> = Union | (T & Record<never, never>);
namespace SyvCSS {
export type GlobalValues = Flexible<'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset'>;
}
// ---- Props ----
export type { Props as MetaHead } from './core/MetaHead.svelte';