To use typescript pages or components you can just change the components files extensions to .tsx and install the react and node typings:
1yarn add -D typescript @types/node
Then after you run npm run dev nextjs will create a tsconfig.json file automatically and you can import typescript files inside you mdx pages.