RU
Ответ
import fs from 'fs/promises'; | |
import path from 'path'; | |
import htmlnano from 'htmlnano'; | |
import html from '@rollup/plugin-html'; | |
const env = process.env.NODE_ENV; | |
const isProd = env === 'production'; | |
const template = async ({ attributes, files, title }) => { |
import { FC, useState, useEffect } from 'react'; | |
import { Count, Timer } from './styled'; | |
interface IProps { | |
initialTime: number; | |
} | |
const Countdown: FC<IProps> = ({ initialTime }) => { | |
const [strokeDasharray, setStrokeDasharray] = useState('283'); |
import styled from 'reshadow'; | |
import html from './shared'; | |
import { createRoot } from 'react-dom'; | |
import './index.css'; | |
const App = () => styled(null)` | |
h1 { | |
color: red; | |
} | |
`(html` |
const getTemperature = (): number => input.temperature(); | |
const printTemperature = (): void => basic.showNumber(getTemperature()) | |
const showIcon = (name: IconNames): void => basic.showIcon(name) | |
const isButtonPressed = (button: Button): boolean => input.buttonIsPressed(button) | |
basic.forever(() => { | |
const isAPressed = isButtonPressed(Button.A) | |
const isBPressed = isButtonPressed(Button.B) | |
if (isAPressed) printTemperature() |
const Point = class { | |
x = 0; | |
y = 0; | |
}; | |
const serializable = Category => class extends Category { | |
toString() { | |
return `[${this.x}, ${this.y}]`; | |
} | |
}; |
module.exports = { | |
parserOptions: { | |
sourceType: 'module', | |
}, | |
env: { | |
es2020: true, | |
browser: true, | |
node: true, | |
jest: true, | |
}, |
import React from 'react'; | |
import axios from 'axios'; | |
import { Redirect } from 'react-router-dom'; | |
import { Row } from './Row'; | |
import { createTable } from '../helpers'; | |
export const Table: React.FC = () => { | |
const url = 'http://localhost:5000'; |
export const createTable = (rowNum: number, cellNum: number): number[][] => { | |
const row: number[] = Array(rowNum).fill(0); | |
const table: number[][] = Array(cellNum) | |
.fill(row) | |
.map((row: number[]) => [...row]); | |
return table; | |
}; | |
export const recalculateTable = (table: number[][], index: number, value: number): number[][] => { |
import React from 'react'; | |
import styled, { ThemeProvider } from 'styled-components'; | |
type Props = { | |
children: React.ReactNode; | |
}; | |
function Cell(props: Props) { | |
const theme = { | |
color: convertColor(props.children), |