import {myFunc} from '....';
........
const handleChangeRoadCosts = (id: number, keyVal: string, val: string) => {
return myFunc(id, keyVal, val, data);
};
.used-p-c:valid {
....
}
type CompanyInfoSectionProps = {
title: string;
to: string;
items: string[];
[key: `_${string}`]: string | boolean;
};
["useVerificationToken", "getUserByEmail"].filter((method) => !adapter[method])
(["useVerificationToken", "getUserByEmail"] as const).filter((method) => !adapter[method])
type Schemas<P extends keyof paths> = paths[P]['post'] extends {requestBody: infer R} ? R : never;
const addTimeDescription = (str) =>
str.replace(/\b\d{1,2}:\d{2}\b(?!.*?\b\d{1,2}:\d{2}\b)/, '$& (время местное)');
// пример использования
const originalString = " с 14:01 к 15:00 работать по плановому";
const updatedString = addTimeDescription(originalString); // ' с 14:01 к 15:00 (время местное) работать по плановому'
/^.*\b\d\d?:\d\d\b/
export function getDocuments<T>(slug: ''): Promise<T[]>;
export function getDocuments<T>(slug: string): Promise<T>;
export function getDocuments<T>(): Promise<T[]>;
export function getDocuments(slug = ''): Promise<unknown> {
const endpoint = `/documents/${slug}`
return getPosts(endpoint);
}
class DataService {
method(callsStore) {
...
callsStore.setCall(...);
}
}
export const setFrame = (titlle: string): setFrameActionType => ({ type: 'SETFRAME', payload: { titlle } });
const columns = [
{
key: "name",
label: "NAME",
},
{
key: "role",
label: "ROLE",
},
{
key: "status",
label: "STATUS",
},
] as const;
type ColumnsType = typeof columns;
const rows: Array<Record<ColumnsType[number]['key'], string> & {key: string}> = [
{
key: "1",
name: "Tony Reichert",
role: "CEO",
status: "Active",
},
{
key: "2",
name: "Zoey Lang",
role: "Technical Lead",
status: "Paused",
},
];
const [field, updateField] = useReducer(fieldReducer, []);
работает без ошибок, применяется перегрузкаfunction useReducer<R extends Reducer<any, any>>(
reducer: R,
initialState: ReducerState<R>,
initializer?: undefined
): [ReducerState<R>, Dispatch<ReducerAction<R>>];