<?php
header('Content-Type: application/json');
print(json_encode($_POST));
interface IAction {
type: string
post: any
}
const test1 = (action: IAction): void => {
console.log(action.post);
};
const test2 = ({ type, post }: IAction): void => {
console.log(post);
}
type TAction = {
type: string;
post: any;
}
const test3 = (action: TAction): void => {
console.log(action.post);
};
const test4 = ({ type, post}: TAction): void => {
console.log(post);
};
value
кладет. Почитайте проv-model
в документации.