mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
20 lines
423 B
TypeScript
20 lines
423 B
TypeScript
// @strict: true
|
|
// @noEmit: true
|
|
// @stableTypeOrdering: true
|
|
|
|
// https://github.com/microsoft/typescript-go/issues/4817
|
|
|
|
type MaybeRef<T> = T | { value: T };
|
|
|
|
declare function f<D = string>(options: {
|
|
select?: MaybeRef<(data: string) => D>;
|
|
}): D | undefined;
|
|
|
|
declare const arg: {
|
|
select?: MaybeRef<(data: string) => string>;
|
|
} & {
|
|
select: (data: string) => number;
|
|
};
|
|
|
|
const n: number | undefined = f(arg);
|