├── .gitignore
├── .umirc.ts
├── README.md
├── docs
├── index.html
├── p__App.async.js
├── p__App.chunk.css
└── umi.js
├── package-lock.json
├── package.json
├── src
├── App.test.tsx
├── Components
│ ├── Coder
│ │ ├── index.less
│ │ └── index.tsx
│ └── Row
│ │ ├── index.less
│ │ ├── index.tsx
│ │ └── row-content.tsx
├── data
│ ├── css
│ │ └── css.ts
│ ├── index.ts
│ ├── js
│ │ ├── js-WebGL.ts
│ │ ├── js-array.ts
│ │ ├── js-date.ts
│ │ ├── js-global.ts
│ │ ├── js-map-set.ts
│ │ ├── js-math.ts
│ │ ├── js-number.ts
│ │ ├── js-object.ts
│ │ ├── js-promise.ts
│ │ ├── js-string.ts
│ │ ├── js-words.js
│ │ └── wd.ts
│ └── test.ts
├── index.tsx
├── pages
│ ├── App.tsx
│ ├── commont.css
│ ├── index.less
│ └── index.tsx
├── react-app-env.d.ts
├── serviceWorker.ts
└── setupTests.ts
├── tsconfig.json
├── typings.d.ts
└── yarn.lock
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 |
12 | /config
13 |
14 | /scripts
15 |
16 | /public
17 |
18 | /build
19 |
20 | # misc
21 | .DS_Store
22 | .env.local
23 | .env.development.local
24 | .env.test.local
25 | .env.production.local
26 |
27 | npm-debug.log*
28 | yarn-debug.log*
29 | yarn-error.log*
30 |
31 | /node_modules
32 | /.env.local
33 | /.umirc.local.ts
34 | /config/config.local.ts
35 | /src/.umi
36 | /src/.umi-production
37 | /src/.umi-test
38 | /dist
39 | .swc
40 |
41 |
--------------------------------------------------------------------------------
/.umirc.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "umi";
2 |
3 | export default defineConfig({
4 | base: "/code-game",
5 | publicPath: "https://ui.zdean.cn/code-game/",
6 | title: "打字练习",
7 | outputPath: 'docs',
8 | routes: [
9 | { path: "/", component: "App" }
10 | ],
11 | npmClient: 'yarn',
12 | });
13 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [https://ui.zdean.cn/code-game/](https://ui.zdean.cn/code-game/)
2 |
3 | 练习打字的同时可以学习js的内置方法
4 |
5 | React hook + TS 实现
6 |
7 | ## 开发环境
8 | 1. 安装[nodejs](https://nodejs.org/zh-cn/download/),版本是 14 或以上
9 | 2. 安装依赖
10 | ```
11 | npm install
12 | ```
13 | 3. 安装完成后运行`npm run start`
14 |
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 打字练习
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/p__App.chunk.css:
--------------------------------------------------------------------------------
1 | *{margin:0;padding:0;font-weight:100!important;font-family:Lucida Console,Monaco,Courier New,Courier,"monospace",\5b8b\4f53!important}.container{width:1000px;margin:0 auto}.select{display:inline-block;width:100px;height:30px}.button{display:inline-block;width:100px;height:30px;vertical-align:middle}.ml-sm{margin-left:10px}.box___Yb0qg{position:relative}.desc___oLf0_{position:absolute;bottom:-105px;height:60px;background:#fff;box-shadow:0 0 3px 3px #0000001a;z-index:100;width:100%;padding:20px}.content-row___cuDKi{display:block;overflow:hidden;width:100%;border:0;border-bottom:1px solid #ddd;outline:none;height:30px;line-height:30px;font-size:18px}.content-row___cuDKi:focus{border-bottom:1px solid #a6c8ff}.content-row___cuDKi .success____Ce89{color:#0f0}.content-row___cuDKi .error___cumZ8{color:red}.result___IS91Q{height:30px;margin-top:20px}
2 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "author": "zhangduo ",
4 | "scripts": {
5 | "dev": "umi dev",
6 | "build": "umi build",
7 | "postinstall": "umi setup",
8 | "setup": "umi setup",
9 | "start": "npm run dev"
10 | },
11 | "dependencies": {
12 | "umi": "^4.0.80"
13 | },
14 | "devDependencies": {
15 | "@types/react": "^18.0.33",
16 | "@types/react-dom": "^18.0.11",
17 | "typescript": "^5.0.3"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/App.test.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { render } from '@testing-library/react';
3 | import App from './pages/App';
4 |
5 | test('renders learn react link', () => {
6 | const { getByText } = render();
7 | const linkElement = getByText(/learn react/i);
8 | expect(linkElement).toBeInTheDocument();
9 | });
10 |
--------------------------------------------------------------------------------
/src/Components/Coder/index.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webzhd/code-game/eb8707ea5a261457e15455c24d32f7258df80457/src/Components/Coder/index.less
--------------------------------------------------------------------------------
/src/Components/Coder/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useState, useImperativeHandle } from 'react'
2 | import Row, { RowRefMethods, ItemType } from '../Row'
3 | import styles from './index.less'
4 |
5 | export interface CoderType {
6 | code: any[],
7 | end: (speed: string, correct: string) => void
8 | }
9 | export interface CoderMethots {
10 | start: () => void
11 | }
12 |
13 | let startTime: number
14 | let endTime: number
15 |
16 |
17 | function Coder (props: CoderType, ref: React.Ref) {
18 | const { code } = props
19 |
20 | const refs: React.RefObject[]= []
21 |
22 |
23 | useImperativeHandle(ref, () => {
24 | return {
25 | start: () => {
26 | start()
27 | }
28 | }
29 | })
30 |
31 | useEffect(() => {
32 | refs.forEach(ref => {
33 | const input = ref.current
34 | if(input) {
35 | input.setIsRead(true)
36 | }
37 | })
38 | }, [code])
39 |
40 | /**
41 | * @param index
42 | * 把当前行设置为只读,下一行设置为可读,并设置焦点
43 | */
44 | function next(index: number) {
45 | const nextInput = refs[index + 1]
46 | const currInput = refs[index]
47 | if(currInput) {
48 | currInput.current!.setIsRead(true)
49 | }
50 | if(nextInput) {
51 | nextInput.current!.setIsRead(false)
52 | nextInput.current!.focus()
53 | }else {
54 | // end
55 | end()
56 | }
57 | }
58 | function prev(index: number) {
59 | const nextInput = refs[index - 1]
60 | if(nextInput) {
61 | nextInput.current!.setIsRead(false)
62 | nextInput.current!.focus()
63 | }else {
64 | const currInput = refs[index]
65 | if(currInput) {
66 | currInput.current!.setIsRead(false)
67 | currInput.current!.focus()
68 | }
69 | }
70 | }
71 |
72 | function start() {
73 | console.log('start')
74 | next(-1)
75 | startTime = new Date().getTime()
76 | }
77 | function end() {
78 | endTime = new Date().getTime()
79 | let all = document.querySelectorAll('.code-atom').length
80 | let errorLength = document.querySelectorAll('.code-error').length
81 | props.end(all / ((endTime - startTime) / 1000) * 60 + 'code / min', (1 - errorLength / all) * 100 + '%')
82 | }
83 |
84 | return (
85 |
86 | {
87 | code.map((row: ItemType[], index) => {
88 | refs[index] = React.createRef()
89 | return
95 | })
96 | }
97 |
98 | )
99 | }
100 |
101 | export default React.forwardRef(Coder)
--------------------------------------------------------------------------------
/src/Components/Row/index.less:
--------------------------------------------------------------------------------
1 | .box {
2 | position: relative;
3 | }
4 | .desc {
5 | position: absolute;
6 | bottom: -105px;
7 | height: 60px;
8 | background: #fff;
9 | box-shadow: 0 0 3px 3px rgba(0,0,0,0.1);
10 | z-index: 100;
11 | width: 100%;
12 | padding: 20px;
13 | }
14 | .content-row {
15 | display: block;
16 | overflow: hidden;
17 | width: 100%;
18 | border: 0;
19 | border-bottom: 1px solid #ddd;
20 | outline: none;
21 | height: 30px;
22 | line-height: 30px;
23 | font-size: 18px;
24 | &:focus {
25 | border-bottom: 1px solid #a6c8ff;
26 | }
27 | .success {
28 | color: #0f0
29 | }
30 | .error {
31 | color: #f00
32 | }
33 | }
--------------------------------------------------------------------------------
/src/Components/Row/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { useState, useRef, useImperativeHandle } from 'react'
2 | import styles from './index.less'
3 |
4 | export interface ItemType {
5 | text: string,
6 | desc: string,
7 | url?: string
8 | }
9 | export interface RowProps {
10 | rowIndex: number,
11 | textArray: ItemType[],
12 | next: () => void,
13 | prev: () => void,
14 | }
15 |
16 | export interface RowRefMethods {
17 | blur: () => void
18 | focus: () => void
19 | setIsRead: (bl: boolean) => void
20 | }
21 |
22 | function Row(props: RowProps, ref: React.Ref) {
23 | let coderNumber = -1
24 | const {textArray} = props
25 | const [targetCode, setTargetCode] = useState('')
26 | const [isReadOnly, setIsReadOnly] = useState(true)
27 | const [itemWord, setItem] = useState()
28 |
29 | const inputRef = useRef(null)
30 | useImperativeHandle(ref, () => {
31 | return {
32 | blur: blur,
33 | focus: focus,
34 | setIsRead: setIsRead
35 | }
36 | })
37 | function blur() {
38 | const input = inputRef.current
39 | if(input) {
40 | input.blur()
41 | }
42 | }
43 | function focus() {
44 | const input = inputRef.current
45 | if(input) {
46 | input.focus()
47 | }
48 | }
49 |
50 | function setIsRead(bl: boolean) {
51 | setIsReadOnly(bl)
52 | }
53 |
54 | function changeInputValue(event: React.ChangeEvent) {
55 | const { value } = event.target
56 |
57 | if(value.length >= coderNumber) {
58 | blur()
59 | props.next()
60 | }
61 | if(value === '' && targetCode !== '') {
62 | console.log('row delete')
63 | blur()
64 | props.prev()
65 | }
66 | if(value.length > coderNumber) return
67 | setTargetCode(value)
68 | }
69 |
70 | function getClassName(code: string, index: number): string {
71 | const valueIndex = targetCode.length - 1
72 | if(index > valueIndex) {
73 | return 'code-atom'
74 | }
75 | if(code === targetCode[index]) {
76 | return `${styles.success} code-success code-atom`
77 | }else{
78 | return `${styles.error} code-error code-atom`
79 | }
80 | }
81 |
82 | function changeDesc(item: ItemType) {
83 | //
84 | if(itemWord !== item) {
85 | setItem(item)
86 | }
87 | }
88 |
89 | function paste(e: React.ClipboardEvent) {
90 | e.preventDefault()
91 | return false
92 | }
93 |
94 | return (
95 |
96 | {
97 | textArray.map((item: ItemType) => {
98 | if(coderNumber === targetCode.length - 1 && !isReadOnly) {
99 | // 进入下一个单词的边界,更新单词描述
100 | changeDesc(item)
101 | }
102 | return [...item.text, ' '].map((code: string) => {
103 | coderNumber = coderNumber + 1
104 | return {code}
105 | })
106 | })
107 | }
108 |
109 |
110 |
112 |
113 | {itemWord && !isReadOnly &&
114 |
[查看详情]{itemWord.desc}
115 |
}
116 |
)
117 | }
118 |
119 | export default React.forwardRef(Row)
--------------------------------------------------------------------------------
/src/Components/Row/row-content.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {ItemType, RowProps} from './index'
3 | function RowContent(props: RowProps) {
4 | // function getClassName(code: string, index: number): string {
5 | // const valueIndex = targetCode.length - 1
6 | // if(index > valueIndex) {
7 | // return ''
8 | // }
9 | // if(code === targetCode[index]) {
10 | // return styles.success
11 | // }else{
12 | // return styles.error
13 | // }
14 | // }
15 | // return <>
16 | // {
17 | // props.textArray.map((item: ItemType, i: number) => {
18 | // return [...item.text, ' '].map((code: string, index: number) => {
19 | // return {code}
20 | // })
21 | // })
22 | // }
23 | // >
24 | }
--------------------------------------------------------------------------------
/src/data/css/css.ts:
--------------------------------------------------------------------------------
1 | const css = [
2 | {
3 | text: 'position',
4 | desc: 'css属性定位'
5 | },
6 | {
7 | text: 'border',
8 | desc: 'css属性边框'
9 | },
10 | {
11 | text: 'color',
12 | desc: 'css属性字体颜色'
13 | },
14 | {
15 | text: 'display',
16 | desc: 'css属性块状态'
17 | },
18 | {
19 | text: 'position',
20 | desc: 'css属性定位'
21 | },
22 | {
23 | text: 'border',
24 | desc: 'css属性边框'
25 | },
26 | {
27 | text: 'color',
28 | desc: 'css属性字体颜色'
29 | },
30 | {
31 | text: 'display',
32 | desc: 'css属性块状态'
33 | },
34 | {
35 | text: 'position',
36 | desc: 'css属性定位'
37 | },
38 | {
39 | text: 'border',
40 | desc: 'css属性边框'
41 | },
42 | {
43 | text: 'color',
44 | desc: 'css属性字体颜色'
45 | },
46 | {
47 | text: 'display',
48 | desc: 'css属性块状态'
49 | }
50 | ]
51 |
52 | export default css;
--------------------------------------------------------------------------------
/src/data/index.ts:
--------------------------------------------------------------------------------
1 | import test from './test'
2 | import jsArray from './js/js-array'
3 | import css from './css/css'
4 | import jsDate from './js/js-date'
5 | import jsMath from './js/js-math'
6 | import jsNumber from './js/js-number'
7 | import jsObject from './js/js-object'
8 | import jsString from './js/js-string'
9 | import jsMapSet from './js/js-map-set'
10 | import jsPromise from './js/js-promise'
11 | import jsGlobal from './js/js-global'
12 | import jsWords from './js/js-words'
13 | import jsWebGL from './js/js-WebGL'
14 |
15 |
16 | function splitRow(data: any[]): any[] {
17 | let result: any[] = [], row: any[] = [], len = 0;
18 | data.forEach((word, i) => {
19 | row.push(word);
20 | len += (word.text?.length + 1);// 单词长度和一个空格
21 | if (len >= 90) { // 超出一行
22 | const item = row.pop(); // 取出最后一个
23 | result.push(row); // 把row放在result里面
24 | row = [item]; // 取出的放到第二行并初始化row
25 | len = item.text.length + 1;
26 | }
27 | })
28 | return result
29 | }
30 | function getLength(data: any[]): number {
31 | return data.reduce((prev, curr) => {
32 | return prev + curr.text.length + 1
33 | }, 0)
34 |
35 | }
36 |
37 | export const testData = splitRow(test)
38 |
39 | export const jsArrayData = splitRow(jsArray)
40 |
41 | export const cssData = splitRow(css)
42 |
43 | export const jsDateData = splitRow(jsDate)
44 |
45 | export const jsMathData = splitRow(jsMath)
46 |
47 | export const jsNumberData = splitRow(jsNumber)
48 |
49 | export const jsObjectData = splitRow(jsObject)
50 |
51 | export const jsStringData = splitRow(jsString)
52 |
53 | export const jsMapSetData = splitRow(jsMapSet)
54 |
55 | export const jsPromiseData = splitRow(jsPromise)
56 |
57 | export const jsGlobalData = splitRow(jsGlobal)
58 |
59 | export const jsWordsData = splitRow(jsWords)
60 |
61 | export const jsWebGLData = splitRow(jsWebGL)
62 |
63 | export const jsAllData = splitRow(jsArray.concat(jsDate, jsMath, jsNumber, jsObject, jsString, jsMapSet, jsPromise, jsGlobal, jsWebGLData))
--------------------------------------------------------------------------------
/src/data/js/js-WebGL.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 |
3 | export default [
4 | {
5 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/activeTexture",
6 | "text": "activeTexture()",
7 | "desc": "用来激活指定的纹理单元。"
8 | },
9 | {
10 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/attachShader",
11 | "text": "attachShader()",
12 | "desc": "attachShader() 方法负责往 WebGLProgram 添加一个片段或者顶点着色器"
13 | },
14 | {
15 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/bindAttribLocation",
16 | "text": "bindAttribLocation()",
17 | "desc": "bindAttribLocation()方法将通用顶点索引绑定到属性变量。"
18 | },
19 | {
20 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/bindBuffer",
21 | "text": "bindBuffer()",
22 | "desc": "bindBuffer()方法将给定的WebGLBuffer绑定到目标"
23 | },
24 | {
25 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/bindFramebuffer",
26 | "text": "bindFramebuffer()",
27 | "desc": "bindFramebuffer() 方法将给定的 WebGLFramebuffer 绑定"
28 | },
29 | {
30 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/bindRenderbuffer",
31 | "text": "bindRenderbuffer()",
32 | "desc": "bindRenderbuffer() 方法将给定的 WebGLRenderbuffer 绑定到一个目标,它必须是 gl.RENDERBUFFER 。"
33 | },
34 | {
35 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/bindTexture",
36 | "text": "bindTexture()",
37 | "desc": "indTexture() 方法将给定的 WebGLTexture 绑定到目标(绑定点)。"
38 | },
39 | {
40 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/blendColor",
41 | "text": "blendColor()",
42 | "desc": "blendColor() 方法用于设置源和目标混合因子。"
43 | },
44 | {
45 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/blendEquation",
46 | "text": "blendEquation()",
47 | "desc": "blendEquation() 方法用于将RGB混合方程和阿尔法混合方程设置为单个方程。"
48 | },
49 | {
50 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/blendEquationSeparate",
51 | "text": "blendEquationSeparate()",
52 | "desc": "blendEquationSeparate() method of the WebGL API is used to set the RGB blend equation and alpha blend equation separately."
53 | },
54 | {
55 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/blendFunc",
56 | "text": "blendFunc()",
57 | "desc": "blendFunc() 方法定义了一个用于混合像素算法的函数."
58 | },
59 | {
60 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/blendFuncSeparate",
61 | "text": "blendFuncSeparate()",
62 | "desc": "blendFuncSeparate() method of the WebGL API defines which function is used for blending pixel arithmetic for RGB and alpha components separately."
63 | },
64 | {
65 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/bufferData",
66 | "text": "bufferData()",
67 | "desc": "bufferData()方法创建并初始化了Buffer对象的数据存储区。"
68 | },
69 | {
70 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/bufferSubData",
71 | "text": "bufferSubData()",
72 | "desc": "bufferSubData() method of the WebGL API updates a subset of a buffer object's data store."
73 | },
74 | {
75 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/checkFramebufferStatus",
76 | "text": "checkFramebufferStatus()",
77 | "desc": "checkFramebufferStatus() method of the WebGL API returns the completeness status of the WebGLFramebuffer object."
78 | },
79 | {
80 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/clear",
81 | "text": "clear()",
82 | "desc": "clear() 方法使用预设值来清空缓冲。 预设值可以使用 clearColor() 、 clearDepth() 或 clearStencil() (en-US) 设置。 裁剪、抖动处理和缓冲写入遮罩会影响 clear() 方法。"
83 | },
84 | {
85 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/clearColor",
86 | "text": "clearColor()",
87 | "desc": "clearColor() 方法用于设置清空颜色缓冲时的颜色值。"
88 | },
89 | {
90 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/clearDepth",
91 | "text": "clearDepth()",
92 | "desc": "clearDepth() 方法用于设置深度缓冲区的深度清除值。"
93 | },
94 | {
95 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/clearStencil",
96 | "text": "clearStencil()",
97 | "desc": "clearStencil() method of the WebGL API specifies the clear value for the stencil buffer."
98 | },
99 | {
100 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/colorMask",
101 | "text": "colorMask()",
102 | "desc": "colorMask() method of the WebGL API sets which color components to enable or to disable when drawing or rendering to a WebGLFramebuffer."
103 | },
104 | {
105 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/commit",
106 | "text": "commit()",
107 | "desc": "当上下文不是直接固定到一个特定的画布时,commit() 方法将帧绘制到其原始的 HTMLCanvasElement 上。"
108 | },
109 | {
110 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/compileShader",
111 | "text": "compileShader()",
112 | "desc": "compileShader() 用于编译一个GLSL着色器,使其成为为二进制数据,然后就可以被WebGLProgram对象所使用."
113 | },
114 | {
115 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/compressedTexImage2D",
116 | "text": "compressedTexImage[23]D()",
117 | "desc": "compressedTexImage[23]D() 在WebGL API 中特指压缩二维或三维纹理图像的格式。"
118 | },
119 | {
120 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/compressedTexSubImage2D",
121 | "text": "compressedTexSubImage2D()",
122 | "desc": "compressedTexSubImage2D() method of the WebGL API specifies a two-dimensional sub-rectangle for a texture image in a compressed format."
123 | },
124 | {
125 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/copyTexImage2D",
126 | "text": "copyTexImage2D()",
127 | "desc": "copyTexImage2D() method of the WebGL API copies pixels from the current WebGLFramebuffer into a 2D texture image."
128 | },
129 | {
130 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/copyTexSubImage2D",
131 | "text": "copyTexSubImage2D()",
132 | "desc": "copyTexSubImage2D() method of the WebGL API copies pixels from the current WebGLFramebuffer into an existing 2D texture sub-image."
133 | },
134 | {
135 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/createBuffer",
136 | "text": "createBuffer()",
137 | "desc": "createBuffer() 方法可创建并初始化一个用于储存顶点数据或着色数据的WebGLBuffer对象"
138 | },
139 | {
140 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/createFramebuffer",
141 | "text": "createFramebuffer()",
142 | "desc": "creatFramebuffer() 是 WebGL API 的一个方法,用来创建和初始化WebGLFramebuffer 对象。"
143 | },
144 | {
145 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/createProgram",
146 | "text": "createProgram()",
147 | "desc": "createProgram() 方法用于创建和初始化一个 WebGLProgram 对象。"
148 | },
149 | {
150 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/createRenderbuffer",
151 | "text": "createRenderbuffer()",
152 | "desc": "createRenderbuffer() 方法 创建并初始化一个 WebGLRenderbuffer 对象。"
153 | },
154 | {
155 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/createShader",
156 | "text": "createShader()",
157 | "desc": "createShader() 用于创建一个 WebGLShader 着色器对象,该对象可以使用 WebGLRenderingContext.shaderSource() 和 WebGLRenderingContext.compileShader() 方法配置着色器代码."
158 | },
159 | {
160 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/createTexture",
161 | "text": "createTexture()",
162 | "desc": "createTexture() 方法创建并初始化了一个WebGLTexture 目标。"
163 | },
164 | {
165 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/cullFace",
166 | "text": "cullFace()",
167 | "desc": "cullFace() 指定正面和/或背面多边形是否可以剔除。"
168 | },
169 | {
170 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/deleteBuffer",
171 | "text": "deleteBuffer()",
172 | "desc": "deleteBuffer()用于删除给定的WebGLBuffer对象;若给定的WebGLBuffer对象已经被删除了,调用该方法将不会产生任何效果。"
173 | },
174 | {
175 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/deleteFramebuffer",
176 | "text": "deleteFramebuffer()",
177 | "desc": "deleteFramebuffer() 方法用来删除给定的WebGLFramebuffer 对象. 如果帧缓冲区已被删除,则此方法无效。."
178 | },
179 | {
180 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/deleteProgram",
181 | "text": "deleteProgram()",
182 | "desc": "deleteProgram() 用于删除一个 WebGLProgram 对象. 如果该WebGLProgram 对象已经被删除,该方法不会产生任何作用"
183 | },
184 | {
185 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/deleteRenderbuffer",
186 | "text": "deleteRenderbuffer()",
187 | "desc": "deleteRenderbuffer() 方法用来删除给定的 WebGLRenderbuffer 对象. 如果渲染缓冲区已被删除,则此方法无效."
188 | },
189 | {
190 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/deleteShader",
191 | "text": "deleteShader()",
192 | "desc": "deleteShader() 用于删除一个参数提供的 WebGLShader对象. 如果该WebGLShader对象已经被删除,该方法不会有任何作用。"
193 | },
194 | {
195 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/deleteTexture",
196 | "text": "deleteTexture()",
197 | "desc": "deleteTexture()方法删除指定的WebGLTexture对象。如果纹理已被删除,则此方法无效。"
198 | },
199 | {
200 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/depthFunc",
201 | "text": "depthFunc()",
202 | "desc": "depthFunc() 方法,指定将输入像素深度与当前深度缓冲区值进行比较的函数。"
203 | },
204 | {
205 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/depthMask",
206 | "text": "depthMask()",
207 | "desc": "depthMask() 方法设置是否启用写入深度缓冲。"
208 | },
209 | {
210 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/depthRange",
211 | "text": "depthRange()",
212 | "desc": ""
213 | },
214 | {
215 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/detachShader",
216 | "text": "detachShader()",
217 | "desc": "detachShader() 方法:从一个 WebGLProgram中分离一个先前附加的片段或者顶点着色器 (WebGLShader ) ."
218 | },
219 | {
220 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/disable",
221 | "text": "disable()",
222 | "desc": "disable() method of the WebGL API disables specific WebGL capabilities for this context."
223 | },
224 | {
225 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/disableVertexAttribArray",
226 | "text": "disableVertexAttribArray()",
227 | "desc": "disableVertexAttribArray() method of the WebGL API turns the generic vertex attribute array off at a given index position."
228 | },
229 | {
230 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/drawArrays",
231 | "text": "drawArrays()",
232 | "desc": "drawArrays()方法用于从向量数组中绘制图元。"
233 | },
234 | {
235 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/drawElements",
236 | "text": "drawElements()",
237 | "desc": "drawElements() 方法 在 WebGL API 从数组数据渲染图元."
238 | },
239 | {
240 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/enable",
241 | "text": "enable()",
242 | "desc": "enable() 方法,用于对该上下文开启某种特性。"
243 | },
244 | {
245 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/enableVertexAttribArray",
246 | "text": "enableVertexAttribArray()",
247 | "desc": "enableVertexAttribArray() 方法,可以打开属性数组列表中指定索引处的通用顶点属性数组。"
248 | },
249 | {
250 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/finish",
251 | "text": "finish()",
252 | "desc": "finish() method of the WebGL API blocks execution until all previously called commands are finished."
253 | },
254 | {
255 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/flush",
256 | "text": "flush()",
257 | "desc": "flush() method of the WebGL API empties different buffer commands, causing all commands to be executed as quickly as possible."
258 | },
259 | {
260 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/framebufferRenderbuffer",
261 | "text": "framebufferRenderbuffer()",
262 | "desc": "framebufferRenderbuffer() method of the WebGL API attaches a WebGLRenderbuffer object to a WebGLFramebuffer object."
263 | },
264 | {
265 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/framebufferTexture2D",
266 | "text": "framebufferTexture2D()",
267 | "desc": "framebufferTexture2D() method of the WebGL API attaches a texture to a WebGLFramebuffer."
268 | },
269 | {
270 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/frontFace",
271 | "text": "frontFace()",
272 | "desc": "frontFace() method of the WebGL API specifies whether polygons are front- or back-facing by setting a winding orientation."
273 | },
274 | {
275 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/generateMipmap",
276 | "text": "generateMipmap()",
277 | "desc": "generateMipmap() method of the WebGL API generates a set of mipmaps for a WebGLTexture object."
278 | },
279 | {
280 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getActiveAttrib",
281 | "text": "getActiveAttrib()",
282 | "desc": "getActiveAttrib() method of the WebGL API returns a WebGLActiveInfo object containing size, type, and name of a vertex attribute. It is generally used when querying unknown attributes either for debugging or generic library creation."
283 | },
284 | {
285 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getActiveUniform",
286 | "text": "getActiveUniform()",
287 | "desc": "getActiveUniform() method of the WebGL API returns a WebGLActiveInfo object containing size, type, and name of a uniform attribute. It is generally used when querying unknown uniforms either for debugging or generic library creation."
288 | },
289 | {
290 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getAttachedShaders",
291 | "text": "getAttachedShaders()",
292 | "desc": "getAttachedShaders() method of the WebGL API returns a list of WebGLShader objects attached to a WebGLProgram."
293 | },
294 | {
295 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getAttribLocation",
296 | "text": "getAttribLocation()",
297 | "desc": "getAttribLocation() 方法返回了给定WebGLProgram对象中某属性的下标指向位置。"
298 | },
299 | {
300 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getBufferParameter",
301 | "text": "getBufferParameter()",
302 | "desc": "getBufferParameter() method of the WebGL API returns information about the buffer."
303 | },
304 | {
305 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getContextAttributes",
306 | "text": "getContextAttributes()",
307 | "desc": "getContextAttributes() 方法返回一个包含实际上下文参数的 WebGLContextAttributes 对象。如果上下文丢失,可能返回 null。"
308 | },
309 | {
310 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getError",
311 | "text": "getError()",
312 | "desc": "getError() method of the WebGL API returns error information."
313 | },
314 | {
315 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getExtension",
316 | "text": "getExtension()",
317 | "desc": "getExtension() 方法可以启用一个 WebGL 扩展。"
318 | },
319 | {
320 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getFramebufferAttachmentParameter",
321 | "text": "getFramebufferAttachmentParameter()",
322 | "desc": "getFramebufferAttachmentParameter() method of the WebGL API returns information about a framebuffer's attachment."
323 | },
324 | {
325 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getParameter",
326 | "text": "getParameter()",
327 | "desc": "getParameter() 方法为传入的参数名称返回一个值。"
328 | },
329 | {
330 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getProgramInfoLog",
331 | "text": "getProgramInfoLog()",
332 | "desc": "getProgramInfoLog 返回参数中指定的WebGLProgram object 的信息. 这些信息包括在linking过程中的错误以及 WebGLProgram objects 合法性检查的错误."
333 | },
334 | {
335 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getProgramParameter",
336 | "text": "getProgramParameter()",
337 | "desc": "getProgramParameter() 方法返回WebGLProgram的信息。"
338 | },
339 | {
340 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getRenderbufferParameter",
341 | "text": "getRenderbufferParameter()",
342 | "desc": "getRenderbufferParameter() method of the WebGL API returns information about the renderbuffer."
343 | },
344 | {
345 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getShaderInfoLog",
346 | "text": "getShaderInfoLog()",
347 | "desc": "getShaderInfoLog returns the information log for the specified WebGLShader object. It contains warnings, debugging and compile information."
348 | },
349 | {
350 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getShaderParameter",
351 | "text": "getShaderParameter()",
352 | "desc": "getShaderParameter() 返回给定的着色器信息"
353 | },
354 | {
355 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getShaderPrecisionFormat",
356 | "text": "getShaderPrecisionFormat()",
357 | "desc": "getShaderPrecisionFormat() method of the WebGL API returns a new WebGLShaderPrecisionFormat object describing the range and precision for the specified shader numeric format."
358 | },
359 | {
360 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getShaderSource",
361 | "text": "getShaderSource()",
362 | "desc": "getShaderSource() 方法以DOMString的形式返回了一个WebGLShader的源码。"
363 | },
364 | {
365 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getSupportedExtensions",
366 | "text": "getSupportedExtensions()",
367 | "desc": "getSupportedExtensions() 方法返回一个所有的支持WebGL 扩展的列表。"
368 | },
369 | {
370 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getTexParameter",
371 | "text": "getTexParameter()",
372 | "desc": "getTexParameter() 此WebGL API方法返回特定的纹理信息。"
373 | },
374 | {
375 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getUniform",
376 | "text": "getUniform()",
377 | "desc": "getUniform() 方法返回指定位置的全局变量的值。"
378 | },
379 | {
380 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getUniformLocation",
381 | "text": "getUniformLocation()",
382 | "desc": ""
383 | },
384 | {
385 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getVertexAttrib",
386 | "text": "getVertexAttrib()",
387 | "desc": "getUniformLocation() returns the location of a specific uniform variable which is part of a given WebGLProgram."
388 | },
389 | {
390 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/getVertexAttribOffset",
391 | "text": "getVertexAttribOffset()",
392 | "desc": "getVertexAttribOffset() method of the WebGL API returns the address of a specified vertex attribute."
393 | },
394 | {
395 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/hint",
396 | "text": "hint()",
397 | "desc": "hint() method of the WebGL API specifies hints for certain behaviors. The interpretation of these hints depend on the implementation."
398 | },
399 | {
400 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/isBuffer",
401 | "text": "isBuffer()",
402 | "desc": "isBuffer() 是 WebGL API 的方法之一。如果传递的 WebGLBuffer 有效则返回 true,否则返回 false。"
403 | },
404 | {
405 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/isContextLost",
406 | "text": "isContextLost()",
407 | "desc": "isContextLost() 方法返回一个Boolean 标记WebGL的上下文是否已经丢失。"
408 | },
409 | {
410 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/isEnabled",
411 | "text": "isEnabled()",
412 | "desc": "isEnabled() 是 WebGL API 方法之一,用来检测给定的 WebGL 功能项在当前上下文是否可用。"
413 | },
414 | {
415 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/isFramebuffer",
416 | "text": "isFramebuffer()",
417 | "desc": "isFramebuffer() method of the WebGL API returns true if the passed WebGLFramebuffer is valid and false otherwise."
418 | },
419 | {
420 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/isProgram",
421 | "text": "isProgram()",
422 | "desc": "isProgram() 函数 将会在WebGLProgram是一个合法的着色器程序(program)时返回 true , 而在其他情况返回false"
423 | },
424 | {
425 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/isRenderbuffer",
426 | "text": "isRenderbuffer()",
427 | "desc": "isRenderbuffer() method of the WebGL API returns true if the passed WebGLRenderbuffer is valid and false otherwise."
428 | },
429 | {
430 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/isShader",
431 | "text": "isShader()",
432 | "desc": "isShader() 方法,在传入的 WebGLShader 有效时返回 true ,否则返回 false 。"
433 | },
434 | {
435 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/isTexture",
436 | "text": "isTexture()",
437 | "desc": "isTexture() method of the WebGL API returns true if the passed WebGLTexture is valid and false otherwise."
438 | },
439 | {
440 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/lineWidth",
441 | "text": "lineWidth()",
442 | "desc": "lineWidth() method of the WebGL API sets the line width of rasterized lines."
443 | },
444 | {
445 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/linkProgram",
446 | "text": "linkProgram()",
447 | "desc": "linkProgram()方法链接给定的WebGLProgram,从而完成为程序的片元和顶点着色器准备GPU代码的过程。"
448 | },
449 | {
450 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/makeXRCompatible",
451 | "text": "makeXRCompatible()",
452 | "desc": "makeXRCompatible() ensures that the rendering context described by the WebGLRenderingContext is ready to render the scene for the immersive WebXR device on which it will be displayed. If necessary, the WebGL layer may reconfigure the context to be ready to render to a different device than it originally was."
453 | },
454 | {
455 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/pixelStorei",
456 | "text": "pixelStorei()",
457 | "desc": "pixelStorei() 是 WebGL API 中用于图像预处理的函数"
458 | },
459 | {
460 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/polygonOffset",
461 | "text": "polygonOffset()",
462 | "desc": "polygonOffset() method of the WebGL API specifies the scale factors and units to calculate depth values."
463 | },
464 | {
465 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/readPixels",
466 | "text": "readPixels()",
467 | "desc": "读取画布中的像素值 readPixels() method of the WebGL API reads a block of pixels from a specified rectangle of the current color framebuffer into an ArrayBufferView object."
468 | },
469 | {
470 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/renderbufferStorage",
471 | "text": "renderbufferStorage()",
472 | "desc": "renderbufferStorage() 方法用来创建和初始化一个渲染缓冲区对象的数据存储."
473 | },
474 | {
475 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/sampleCoverage",
476 | "text": "sampleCoverage()",
477 | "desc": "sampleCoverage() method of the WebGL API specifies multi-sample coverage parameters for anti-aliasing effects."
478 | },
479 | {
480 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/scissor",
481 | "text": "scissor()",
482 | "desc": "scissor() 方法指定了一个裁剪区域,用来将绘图区域限制在其限定的盒形区域内。"
483 | },
484 | {
485 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/shaderSource",
486 | "text": "shaderSource()",
487 | "desc": "shaderSource() 方法用于设置 WebGLShader 着色器(顶点着色器及片元着色器)的GLSL程序代码。"
488 | },
489 | {
490 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/stencilFunc",
491 | "text": "stencilFunc()",
492 | "desc": "stencilFunc() method of the WebGL API sets the front and back function and reference value for stencil testing."
493 | },
494 | {
495 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/stencilFuncSeparate",
496 | "text": "stencilFuncSeparate()",
497 | "desc": "stencilFuncSeparate() method of the WebGL API sets the front and/or back function and reference value for stencil testing."
498 | },
499 | {
500 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/stencilMask",
501 | "text": "stencilMask()",
502 | "desc": "stencilMask() method of the WebGL API controls enabling and disabling of both the front and back writing of individual bits in the stencil planes."
503 | },
504 | {
505 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/stencilMaskSeparate",
506 | "text": "stencilMaskSeparate()",
507 | "desc": "stencilMaskSeparate() method of the WebGL API controls enabling and disabling of front and/or back writing of individual bits in the stencil planes."
508 | },
509 | {
510 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/stencilOp",
511 | "text": "stencilOp()",
512 | "desc": "stencilOp() method of the WebGL API sets both the front and back-facing stencil test actions."
513 | },
514 | {
515 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/stencilOpSeparate",
516 | "text": "stencilOpSeparate()",
517 | "desc": "stencilOpSeparate() method of the WebGL API sets the front and/or back-facing stencil test actions."
518 | },
519 | {
520 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/texImage2D",
521 | "text": "texImage2D()",
522 | "desc": "texImage2D() 方法指定了二维纹理图像。"
523 | },
524 | {
525 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/texParameter",
526 | "text": "texParameter[fi]()",
527 | "desc": "texParameter[fi]()方法用于设置纹理参数."
528 | },
529 | {
530 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/texSubImage2D",
531 | "text": "texSubImage2D()",
532 | "desc": "texSubImage2D() method of the WebGL API specifies a sub-rectangle of the current texture."
533 | },
534 | {
535 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/uniform",
536 | "text": "uniform[1234][fi][v]()",
537 | "desc": "uniform[1234][fi][v]() 方法指定了uniform 变量的值。所有在ShaderProgram对象中定义的,且激活的uniform变量在ShaderProgram 执行link成功后被初始化为0。它们将保留通过调用此方法分配给它们的值,直到再次将其初始化为0时,也就是ShaderProgram对象上发生下一次成功的link操作为止。"
538 | },
539 | {
540 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/uniformMatrix",
541 | "text": "uniformMatrix[234]fv()",
542 | "desc": "uniformMatrix[234]fv() 方法为 uniform variables 指定了矩阵值 ."
543 | },
544 | {
545 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/useProgram",
546 | "text": "useProgram()",
547 | "desc": "useProgram() 方法将定义好的WebGLProgram 对象添加到当前的渲染状态中。"
548 | },
549 | {
550 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/validateProgram",
551 | "text": "validateProgram()",
552 | "desc": "validateProgram() 是一种 WebGL API ,主要是用来验证 WebGLProgram。 它在检查 WebGLProgram 程序是否链接成功的同时还会检查其是否能在当前的 WebGL 中使用。"
553 | },
554 | {
555 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/vertexAttrib",
556 | "text": "vertexAttrib[1234]f[v]()",
557 | "desc": "vertexAttrib[1234]f[v]() 是 WebGL API 的方法,可以为顶点attibute变量赋值。"
558 | },
559 | {
560 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/vertexAttribPointer",
561 | "text": "vertexAttribPointer()",
562 | "desc": "告诉显卡从当前绑定的缓冲区(bindBuffer()指定的缓冲区)中读取顶点数据。vertexAttribPointer()方法绑定当前缓冲区范围到gl.ARRAY_BUFFER,成为当前顶点缓冲区对象的通用顶点属性并指定它的布局(缓冲区对象中的偏移量)。"
563 | },
564 | {
565 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/viewport",
566 | "text": "viewport()",
567 | "desc": "viewport() 方法,用来设置视口,即指定从标准设备到窗口坐标的x、y仿射变换。"
568 | }
569 | ]
--------------------------------------------------------------------------------
/src/data/js/js-array.ts:
--------------------------------------------------------------------------------
1 | export default [
2 | {
3 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/from',
4 | 'text': 'Array.from()',
5 | 'desc': 'Array.from() 方法从一个类似数组或可迭代对象中创建一个新的数组实例。'
6 | }, {
7 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray',
8 | 'text': 'Array.isArray()',
9 | 'desc': 'Array.isArray() 用于确定传递的值是否是一个 Array。'
10 | }, {
11 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/observe',
12 | 'text': 'Array.observe()',
13 | 'desc': 'Array.observe() 方法用于异步监视数组发生的变化,类似于针对对象的 Object.observe() 。当数组的值发生变化时,它按发生顺序提供了一个变化流。与 Object.observe() 类似,它由如下可接受的变化类型列表[\'add\'、\'update\'、\'delete\'、\'splice\']触发。'
14 | }, {
15 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/of',
16 | 'text': 'Array.of()',
17 | 'desc': 'Array.of() 方法创建一个具有可变数量参数的新数组实例,而不考虑参数的数量或类型。'
18 | }, {
19 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/concat',
20 | 'text': 'concat()',
21 | 'desc': 'concat() 方法用于合并两个或多个数组。此方法不会更改现有数组,而是返回一个新数组。'
22 | }, {
23 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin',
24 | 'text': 'copyWithin()',
25 | 'desc': '改变了的数组。'
26 | }, {
27 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/entries',
28 | 'text': 'entries()',
29 | 'desc': 'entries() 方法返回一个新的Array Iterator对象,该对象包含数组中每个索引的键/值对。'
30 | }, {
31 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/every',
32 | 'text': 'every()',
33 | 'desc': 'every() 方法测试数组的所有元素是否都通过了指定函数的测试。'
34 | }, {
35 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/fill',
36 | 'text': 'fill()',
37 | 'desc': 'fill() 方法用一个固定值填充一个数组中从起始索引到终止索引内的全部元素。'
38 | }, {
39 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/filter',
40 | 'text': 'filter()',
41 | 'desc': 'filter() 方法创建一个新数组, 其包含通过所提供函数实现的测试的所有元素。'
42 | }, {
43 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/find',
44 | 'text': 'find()',
45 | 'desc': 'find() 方法返回数组中满足提供的测试函数的第一个元素的值。否则返回 undefined。'
46 | }, {
47 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex',
48 | 'text': 'findIndex()',
49 | 'desc': 'findIndex()方法返回数组中满足提供的测试函数的第一个元素的索引。否则返回-1。'
50 | }, {
51 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/flat',
52 | 'text': 'flat()',
53 | 'desc': 'flat() 方法会递归到指定深度将所有子数组连接,并返回一个新数组。'
54 | }, {
55 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap',
56 | 'text': 'flatMap()',
57 | 'desc': 'flatMap()方法首先使用映射函数映射每个元素,然后将结果压缩成一个新数组。它与 map 和 深度值1的 flatten 几乎相同,但flatMap通常在合并成一种方法的效率稍微高一些。'
58 | }, {
59 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach',
60 | 'text': 'forEach()',
61 | 'desc': 'forEach() 方法对数组的每个元素执行一次提供的函数。'
62 | }, {
63 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/includes',
64 | 'text': 'includes()',
65 | 'desc': 'includes() 方法用来判断一个数组是否包含一个指定的值,根据情况,如果包含则返回 true,否则返回false。'
66 | }, {
67 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf',
68 | 'text': 'indexOf()',
69 | 'desc': 'indexOf()方法返回在数组中可以找到一个给定元素的第一个索引,如果不存在,则返回-1。'
70 | }, {
71 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/join',
72 | 'text': 'join()',
73 | 'desc': 'join() 方法将一个数组(或一个类数组对象)的所有元素连接成一个字符串并返回这个字符串。'
74 | }, {
75 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/keys',
76 | 'text': 'keys()',
77 | 'desc': 'keys() 方法返回一个新的Array迭代器,它包含数组中每个索引的键。'
78 | }, {
79 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf',
80 | 'text': 'lastIndexOf()',
81 | 'desc': 'lastIndexOf() 方法返回指定元素(也即有效的 JavaScript 值或变量)在数组中的最后一个的索引,如果不存在则返回 -1。从数组的后面向前查找,从 fromIndex 处开始。'
82 | }, {
83 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/map',
84 | 'text': 'map()',
85 | 'desc': 'map() 方法创建一个新数组,其结果是该数组中的每个元素都调用一个提供的函数后返回的结果。'
86 | }, {
87 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/pop',
88 | 'text': 'pop()',
89 | 'desc': 'pop()方法从数组中删除最后一个元素,并返回该元素的值。此方法更改数组的长度。'
90 | }, {
91 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/push',
92 | 'text': 'push()',
93 | 'desc': 'push() 方法将一个或多个元素添加到数组的末尾,并返回新数组的长度。'
94 | }, {
95 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce',
96 | 'text': 'reduce()',
97 | 'desc': 'reduce() 方法对累加器和数组中的每个元素(从左到右)应用一个函数,将其减少为单个值。'
98 | }, {
99 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/ReduceRight',
100 | 'text': 'reduceRight()',
101 | 'desc': 'reduceRight() 方法接受一个函数作为累加器(accumulator)和数组的每个值(从右到左)将其减少为单个值。'
102 | }, {
103 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse',
104 | 'text': 'reverse()',
105 | 'desc': 'reverse() 方法将数组中元素的位置颠倒。'
106 | }, {
107 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/shift',
108 | 'text': 'shift()',
109 | 'desc': 'shift() 方法从数组中删除第一个元素,并返回该元素的值。此方法更改数组的长度。'
110 | }, {
111 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/slice',
112 | 'text': 'slice()',
113 | 'desc': 'slice() 方法返回一个从开始到结束(不包括结束)选择的数组的一部分浅拷贝到一个新数组对象。且原始数组不会被修改。'
114 | }, {
115 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/some',
116 | 'text': 'some()',
117 | 'desc': 'some() 方法测试数组中的某些元素是否通过由提供的函数实现的测试。'
118 | }, {
119 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/sort',
120 | 'text': 'sort()',
121 | 'desc': 'sort() 方法用就地( in-place )的算法对数组的元素进行排序,并返回数组。 sort 排序不一定是稳定的。默认排序顺序是根据字符串Unicode码点。'
122 | }, {
123 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/splice',
124 | 'text': 'splice()',
125 | 'desc': 'splice() 方法通过删除现有元素和/或添加新元素来更改一个数组的内容。'
126 | }, {
127 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString',
128 | 'text': 'toLocaleString()',
129 | 'desc': 'toLocaleString() 返回一个字符串表示数组中的元素。数组中的元素将使用各自的 toLocaleString 方法转成字符串,这些字符串将使用一个特定语言环境的字符串(例如一个逗号 \',\')隔开。'
130 | }, {
131 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/toSource',
132 | 'text': 'toSource()',
133 | 'desc': '返回一个字符串,代表该数组的源代码.'
134 | }, {
135 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/toString',
136 | 'text': 'toString()',
137 | 'desc': 'toString() 返回一个字符串,表示指定的数组及其元素。'
138 | }, {
139 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift',
140 | 'text': 'unshift()',
141 | 'desc': 'unshift() 方法将一个或多个元素添加到数组的开头,并返回新数组的长度。'
142 | }, {
143 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/values',
144 | 'text': 'values()',
145 | 'desc': 'values() 方法返回一个新的 Array Iterator 对象,该对象包含数组每个索引的值'
146 | }
147 | ]
--------------------------------------------------------------------------------
/src/data/js/js-date.ts:
--------------------------------------------------------------------------------
1 | export default [
2 | {
3 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC',
4 | 'text': 'Date.UTC()',
5 | 'desc': 'Date.UTC() 方法接受的参数同日期构造函数接受最多参数时一样,返回从1970-1-1 00:00:00 UTC到指定日期的的毫秒数。'
6 | }, {
7 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/now',
8 | 'text': 'Date.now()',
9 | 'desc': 'Date.now() 方法返回自1970年1月1日 00:00:00 UTC到当前时间的毫秒数。'
10 | }, {
11 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/parse',
12 | 'text': 'Date.parse()',
13 | 'desc': 'Date.parse() 方法解析一个表示某个日期的字符串,并返回从1970-1-1 00:00:00 UTC 到该日期对象(该日期对象的UTC时间)的毫秒数,如果该字符串无法识别,或者一些情况下,包含了不合法的日期数值(如:2015-02-31),则返回值为NaN。'
14 | }, {
15 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/getDate',
16 | 'text': 'getDate()',
17 | 'desc': '根据本地时间,返回一个指定的日期对象为一个月中的第几天。'
18 | }, {
19 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/getDay',
20 | 'text': 'getDay()',
21 | 'desc': 'getDay() 方法根据本地时间,返回一个具体日期中一周的第几天,0 表示星期天。'
22 | }, {
23 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/getFullYear',
24 | 'text': 'getFullYear()',
25 | 'desc': 'getFullYear() 方法根据本地时间返回指定日期的年份。'
26 | }, {
27 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/getHours',
28 | 'text': 'getHours()',
29 | 'desc': 'getHours() 方法根据本地时间,返回一个指定的日期对象的小时。'
30 | }, {
31 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds',
32 | 'text': 'getMilliseconds()',
33 | 'desc': 'getMilliseconds() 方法,根据本地时间,返回一个指定的日期对象的毫秒数。'
34 | }, {
35 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/getMinutes',
36 | 'text': 'getMinutes()',
37 | 'desc': 'getMinutes() 方法根据本地时间,返回一个指定的日期对象的分钟数。'
38 | }, {
39 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/getMonth',
40 | 'text': 'getMonth()',
41 | 'desc': '根据本地时间,返回一个指定的日期对象的月份,为基于0的值(0表示一年中的第一月)。'
42 | }, {
43 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/getSeconds',
44 | 'text': 'getSeconds()',
45 | 'desc': 'getSeconds() 方法根据本地时间,返回一个指定的日期对象的秒数。'
46 | }, {
47 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime',
48 | 'text': 'getTime()',
49 | 'desc': 'getTime() 方法返回一个时间的格林威治时间数值。'
50 | }, {
51 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset',
52 | 'text': 'getTimezoneOffset()',
53 | 'desc': 'getTimezoneOffset() 方法返回协调世界时(UTC)相对于当前时区的时间差值,单位为分钟。'
54 | }, {
55 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/getYear',
56 | 'text': 'getYear()',
57 | 'desc': 'getYear() 方法返回指定的本地日期的年份。因为 getYear 不返回千禧年[full years] (\'year 2000 problem\'),所以这个方法不再被使用,现在替换为 getFullYear .'
58 | }, {
59 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/setDate',
60 | 'text': 'setDate()',
61 | 'desc': 'setDate() 方法根据本地时间来指定一个日期对象的天数。'
62 | }, {
63 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/setFullYear',
64 | 'text': 'setFullYear()',
65 | 'desc': 'setFullYear() 方法根据本地时间为一个日期对象设置年份。'
66 | }, {
67 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/setHours',
68 | 'text': 'setHours()',
69 | 'desc': 'setHours() 方法根据本地时间为一个日期对象设置小时数,返回从1970-01-01 00:00:00 UTC 到更新后的 日期 对象实例所表示时间的毫秒数。'
70 | }, {
71 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/setMilliseconds',
72 | 'text': 'setMilliseconds()',
73 | 'desc': 'setMilliseconds() 方法会根据本地时间设置一个日期对象的豪秒数。'
74 | }, {
75 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/setMinutes',
76 | 'text': 'setMinutes()',
77 | 'desc': 'setMinutes() 方法根据本地时间为一个日期对象设置分钟数。'
78 | }, {
79 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/setMonth',
80 | 'text': 'setMonth()',
81 | 'desc': 'setMonth() 方法根据本地时间为一个设置年份的日期对象设置月份。'
82 | }, {
83 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/setSeconds',
84 | 'text': 'setSeconds()',
85 | 'desc': 'setSeconds() 方法根据本地时间设置一个日期对象的秒数。'
86 | }, {
87 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/setTime',
88 | 'text': 'setTime()',
89 | 'desc': 'setTime() 方法以一个表示从1970-1-1 00:00:00 UTC计时的毫秒数为来为 Date 对象设置时间。'
90 | }, {
91 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/setYear',
92 | 'text': 'setYear()',
93 | 'desc': 'The setYear() method sets the year for a specified date according to local time. Because setYear does not set full years (\'year 2000 problem\'), it is no longer used and has been replaced by the setFullYear method.'
94 | }, {
95 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString',
96 | 'text': 'toDateString()',
97 | 'desc': 'toDateString() 方法以美式英语和人类易读的形式返回一个日期对象日期部分的字符串。'
98 | }, {
99 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/toGMTString',
100 | 'text': 'toGMTString()',
101 | 'desc': 'The toGMTString() method converts a date to a string, using Internet GMT conventions. The exact format of the value returned by toGMTString varies according to the platform and browser, in general it should represent a human readable date string.'
102 | }, {
103 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString',
104 | 'text': 'toISOString()',
105 | 'desc': 'toISOString() 方法返回一个 ISO(ISO 8601 Extended Format)格式的字符串: YYYY-MM-DDTHH:mm:ss.sssZ。时区总是UTC(协调世界时),加一个后缀“Z”标识。'
106 | }, {
107 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON',
108 | 'text': 'toJSON()',
109 | 'desc': 'toJSON() 方法返回 Date 对象的字符串形式。'
110 | }, {
111 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString',
112 | 'text': 'toLocaleDateString()',
113 | 'desc': 'toLocaleDateString() 方法返回该日期对象日期部分的字符串,该字符串格式因不同语言而不同。新增的参数 locales 和 options 使程序能够指定使用哪种语言格式化规则,允许定制该方法的表现(behavior)。在旧版本浏览器中, locales 和 options 参数被忽略,使用的语言环境和返回的字符串格式是各自独立实现的。'
114 | }, {
115 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleFormat',
116 | 'text': 'toLocaleFormat()',
117 | 'desc': '非标准方法 toLocaleFormat() 按特定的格式将一个日期转换成一个字符串。 Intl.DateTimeFormat 是符合标准的格式化日期的替代方法。另见更新的(newer)版本的 toLocaleDateString()方法.'
118 | }, {
119 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString',
120 | 'text': 'toLocaleString()',
121 | 'desc': 'toLocaleString() 方法返回该日期对象的字符串,该字符串格式因不同语言而不同。新增的参数 locales 和 options 使程序能够指定使用哪种语言格式化规则,允许定制该方法的表现(behavior)。在旧版本浏览器中, locales 和 options 参数被忽略,使用的语言环境和返回的字符串格式是各自独立实现的。'
122 | }, {
123 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString',
124 | 'text': 'toLocaleTimeString()',
125 | 'desc': 'The toLocaleTimeString() 方法返回该日期对象时间部分的字符串,该字符串格式因不同语言而不同。新增的参数 locales 和 options 使程序能够指定使用哪种语言格式化规则,允许定制该方法的表现(behavior)。在旧版本浏览器中, locales 和 options 参数被忽略,使用的语言环境和返回的字符串格式是各自独立实现的。'
126 | }, {
127 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/toSource',
128 | 'text': 'toSource()',
129 | 'desc': 'toSource() 返回表示源代码的字符串。'
130 | }, {
131 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/toString',
132 | 'text': 'toString()',
133 | 'desc': 'toString() 方法返回一个字符串,表示该Date对象。'
134 | }, {
135 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString',
136 | 'text': 'toTimeString()',
137 | 'desc': 'toTimeString() 方法以人类易读形式返回一个日期对象时间部分的字符串,该字符串以美式英语格式化。'
138 | }
139 | ]
--------------------------------------------------------------------------------
/src/data/js/js-global.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | export default [
3 | {
4 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/eval",
5 | "text": "eval()",
6 | "desc": "eval() 函数会将传入的字符串当做 JavaScript 代码进行执行。"
7 | },
8 | {
9 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/isFinite",
10 | "text": "isFinite()",
11 | "desc": "该全局 isFinite() 函数用来判断被传入的参数值是否为一个有限数值(finite number)。在必要情况下,参数会首先转为一个数值。"
12 | },
13 | {
14 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/isNaN",
15 | "text": "isNaN()",
16 | "desc": "isNaN() 函数用来确定一个值是否为NaN 。注:isNaN函数内包含一些非常有趣的规则;你也可以使用 ECMAScript 2015 中定义的 Number.isNaN() 来判断。"
17 | },
18 | {
19 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/parseFloat",
20 | "text": "parseFloat()",
21 | "desc": "parseFloat() 函数解析一个参数(必要时先转换为字符串)并返回一个浮点数。"
22 | },
23 | {
24 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/parseInt",
25 | "text": "parseInt()",
26 | "desc": "parseInt(string, radix) 将一个字符串 string 转换为 radix 进制的整数, radix 为介于2-36之间的数。"
27 | },
28 | {
29 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/decodeURI",
30 | "text": "decodeURI()",
31 | "desc": "decodeURI() 函数解码一个由encodeURI 先前创建的统一资源标识符(URI)或类似的例程。"
32 | },
33 | {
34 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent",
35 | "text": "decodeURIComponent()",
36 | "desc": "decodeURIComponent() 方法用于解码由 encodeURIComponent 方法或者其它类似方法编码的部分统一资源标识符(URI)。"
37 | },
38 | {
39 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/encodeURI",
40 | "text": "encodeURI()",
41 | "desc": "encodeURI() 函数通过将特定字符的每个实例替换为一个、两个、三或四转义序列来对统一资源标识符 (URI) 进行编码 (该字符的 UTF-8 编码仅为四转义序列)由两个 \"代理\" 字符组成)。"
42 | },
43 | {
44 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent",
45 | "text": "encodeURIComponent()",
46 | "desc": "encodeURIComponent()是对统一资源标识符(URI)的组成部分进行编码的方法。它使用一到四个转义序列来表示字符串中的每个字符的UTF-8编码(只有由两个Unicode代理区字符组成的字符才用四个转义字符编码)。"
47 | }
48 | ]
49 | /* eslint-disable */
--------------------------------------------------------------------------------
/src/data/js/js-map-set.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 |
3 | export default [
4 | {
5 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Map/clear",
6 | "text": "clear()",
7 | "desc": "clear()方法会移除Map对象中的所有元素。"
8 | },
9 | {
10 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Map/delete",
11 | "text": "delete()",
12 | "desc": " delete() 方法用于移除 Map 对象中指定的元素。"
13 | },
14 | {
15 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Map/entries",
16 | "text": "entries()",
17 | "desc": "entries() 方法返回一个新的包含 [key, value] 对的 Iterator 对象,返回的迭代器的迭代顺序与 Map 对象的插入顺序相同。"
18 | },
19 | {
20 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach",
21 | "text": "forEach()",
22 | "desc": "forEach() 方法将会以插入顺序对 Map 对象中的每一个键值对执行一次参数中提供的回调函数。"
23 | },
24 | {
25 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Map/get",
26 | "text": "get()",
27 | "desc": "get() 方法返回某个 Map 对象中的一个指定元素。"
28 | },
29 | {
30 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Map/has",
31 | "text": "has()",
32 | "desc": "方法has() 返回一个bool值,用来表明map 中是否存在指定元素."
33 | },
34 | {
35 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Map/keys",
36 | "text": "keys()",
37 | "desc": "keys() 返回一个新的 Iterator 对象。它包含按照顺序插入 Map 对象中每个元素的key值。"
38 | },
39 | {
40 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Map/set",
41 | "text": "set()",
42 | "desc": "set() 方法为 Map 对象添加或更新一个指定了键(key)和值(value)的(新)键值对。"
43 | },
44 | {
45 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Map/values",
46 | "text": "values()",
47 | "desc": "一个新的 Map 可迭代对象."
48 | },
49 | {
50 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Set/add",
51 | "text": "add()",
52 | "desc": "add() 方法用来向一个 Set 对象的末尾添加一个指定的值。"
53 | },
54 | {
55 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Set/clear",
56 | "text": "clear()",
57 | "desc": "clear() 方法用来清空一个 Set 对象中的所有元素。"
58 | },
59 | {
60 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Set/delete",
61 | "text": "delete()",
62 | "desc": "delete() 方法可以从一个 Set 对象中删除指定的元素。"
63 | },
64 | {
65 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Set/entries",
66 | "text": "entries()",
67 | "desc": "entries() 方法返回一个新的迭代器对象 ,这个对象的元素是类似 [value, value] 形式的数组,value 是集合对象中的每个元素,迭代器对象元素的顺序即集合对象中元素插入的顺序。由于集合对象不像 Map 对象那样拥有 key,然而,为了与 Map 对象的 API 形式保持一致,故使得每一个 entry 的 key 和 value 都拥有相同的值,因而最终返回一个 [value, value] 形式的数组。"
68 | },
69 | {
70 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Set/forEach",
71 | "text": "forEach()",
72 | "desc": "forEach 方法会根据集合中元素的插入顺序,依次执行提供的回调函数。"
73 | },
74 | {
75 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Set/has",
76 | "text": "has()",
77 | "desc": "has() 方法返回一个布尔值来指示对应的值value是否存在Set对象中。"
78 | },
79 | {
80 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Set/values",
81 | "text": "values()",
82 | "desc": "values() 方法返回一个 Iterator 对象,该对象按照原Set 对象元素的插入顺序返回其所有元素。"
83 | }
84 | ]
85 |
86 | /* eslint-disable */
--------------------------------------------------------------------------------
/src/data/js/js-math.ts:
--------------------------------------------------------------------------------
1 | export default [
2 | {
3 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/PI',
4 | 'text': 'Math.PI',
5 | 'desc': 'Math.PI 表示一个圆的周长与直径的比例,约为 3.14159:'
6 | }, {
7 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT1_2',
8 | 'text': 'Math.SQRT1_2',
9 | 'desc': 'Math.SQRT1_2 属性表示 1/2 的平方根,约为 0.707:'
10 | }, {
11 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/SQRT2',
12 | 'text': 'Math.SQRT2',
13 | 'desc': 'Math.SQRT2 属性表示 2 的平方根,约为 1.414:'
14 | }, {
15 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/abs',
16 | 'text': 'Math.abs()',
17 | 'desc': 'Math.abs(x) 函数返回指定数字 “x“ 的绝对值。如下:'
18 | }, {
19 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/acos',
20 | 'text': 'Math.acos()',
21 | 'desc': 'Math.acos() 返回一个数的反余弦值(单位为弧度),即:'
22 | }, {
23 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/%E5%8F%8D%E5%8F%8C%E6%9B%B2%E4%BD%99%E5%BC%A6%E5%80%BC',
24 | 'text': 'Math.acosh()',
25 | 'desc': 'Math.acosh()返回一个数字的反双曲余弦值,即:'
26 | }, {
27 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/asin',
28 | 'text': 'Math.asin()',
29 | 'desc': 'Math.asin() 方法返回一个数值的反正弦(单位为弧度),即:'
30 | }, {
31 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh',
32 | 'text': 'Math.asinh()',
33 | 'desc': 'Math.asinh() 函数返回给定数字的反双曲正弦值, 即:'
34 | }, {
35 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/atan',
36 | 'text': 'Math.atan()',
37 | 'desc': 'Math.atan() 函数返回一个数值的反正切(以弧度为单位),即:'
38 | }, {
39 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/atan2',
40 | 'text': 'Math.atan2()',
41 | 'desc': 'Math.atan2() 返回其参数比值的反正切值。'
42 | }, {
43 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/atanh',
44 | 'text': 'Math.atanh()',
45 | 'desc': 'Math.atanh() 函数返回一个数值反双曲正切值, 即:'
46 | }, {
47 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt',
48 | 'text': 'Math.cbrt()',
49 | 'desc': 'Math.cbrt() 函数返回任意数字的立方根.'
50 | }, {
51 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/ceil',
52 | 'text': 'Math.ceil()',
53 | 'desc': 'Math.ceil() 函数返回大于或等于一个给定数字的最小整数。'
54 | }, {
55 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32',
56 | 'text': 'Math.clz32()',
57 | 'desc': 'Math.clz32() 函数返回一个数字在转换成 32 无符号整形数字的二进制形式后, 开头的 0 的个数, 比如 1000000 转换成 32 位无符号整形数字的二进制形式后是 00000000000011110100001001000000, 开头的 0 的个数是 12 个, 则 Math.clz32(1000000) 返回 12.'
58 | }, {
59 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/cos',
60 | 'text': 'Math.cos()',
61 | 'desc': 'Math.cos() 函数返回一个数值的余弦值。'
62 | }, {
63 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/cosh',
64 | 'text': 'Math.cosh()',
65 | 'desc': 'Math.cosh() 函数返回数值的双曲余弦函数, 可用 constant e 表示:'
66 | }, {
67 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/exp',
68 | 'text': 'Math.exp()',
69 | 'desc': 'Math.exp() 函数返回 ex,x 表示参数,e 是欧拉常数(Euler\'s constant),自然对数的底数。'
70 | }, {
71 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/expm1',
72 | 'text': 'Math.expm1()',
73 | 'desc': 'Math.expm1() 函数返回 Ex - 1, 其中 x 是该函数的参数, E 是自然对数的底数 2.718281828459045.'
74 | }, {
75 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/floor',
76 | 'text': 'Math.floor()',
77 | 'desc': 'Math.floor() 返回小于或等于一个给定数字的最大整数。'
78 | }, {
79 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/fround',
80 | 'text': 'Math.fround()',
81 | 'desc': 'Math.fround() 可以将任意的数字转换为离它最近的单精度浮点数形式的数字。'
82 | }, {
83 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/hypot',
84 | 'text': 'Math.hypot()',
85 | 'desc': 'Math.hypot() 函数返回它的所有参数的平方和的平方根,即:'
86 | }, {
87 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/imul',
88 | 'text': 'Math.imul()',
89 | 'desc': '该函数返回两个参数的类C的32位整数乘法运算的运算结果.'
90 | }, {
91 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/log',
92 | 'text': 'Math.log()',
93 | 'desc': 'Math.log() 函数返回一个数的自然对数,即:'
94 | }, {
95 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/log10',
96 | 'text': 'Math.log10()',
97 | 'desc': 'Math.log10() 函数返回一个数字以 10 为底的对数.'
98 | }, {
99 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/log1p',
100 | 'text': 'Math.log1p()',
101 | 'desc': 'Math.log1p() 函数返回一个数字加1后的自然对数 (底为 E), 既log(x+1).'
102 | }, {
103 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/log2',
104 | 'text': 'Math.log2()',
105 | 'desc': 'Math.log2() 函数返回一个数字以 2 为底的对数.'
106 | }, {
107 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/max',
108 | 'text': 'Math.max()',
109 | 'desc': 'Math.max() 函数返回一组数中的最大值。'
110 | }, {
111 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/min',
112 | 'text': 'Math.min()',
113 | 'desc': 'Math.min() 返回零个或更多个数值的最小值。'
114 | }, {
115 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/pow',
116 | 'text': 'Math.pow()',
117 | 'desc': 'Math.pow() 函数返回基数(base)的指数(exponent)次幂,即 baseexponent。'
118 | }, {
119 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/random',
120 | 'text': 'Math.random()',
121 | 'desc': 'Math.random() 函数返回一个浮点, 伪随机数在范围[0,1),也就是说,从0(包括0)往上,但是不包括1(排除1),然后您可以缩放到所需的范围。实现将初始种子选择到随机数生成算法;它不能被用户选择或重置。他不能被用户选择或重置。'
122 | }, {
123 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/round',
124 | 'text': 'Math.round()',
125 | 'desc': 'Math.round() 函数返回一个数字四舍五入后最接近的整数。'
126 | }, {
127 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/sign',
128 | 'text': 'Math.sign()',
129 | 'desc': 'Math.sign() 函数返回一个数字的符号, 指示数字是正数,负数还是零。'
130 | }, {
131 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/sin',
132 | 'text': 'Math.sin()',
133 | 'desc': 'Math.sin() 函数返回一个数值的正弦值。'
134 | }, {
135 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/sinh',
136 | 'text': 'Math.sinh()',
137 | 'desc': 'Math.sinh() 函数返回一个数字(单位为角度)的双曲正弦值.'
138 | }, {
139 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/sqrt',
140 | 'text': 'Math.sqrt()',
141 | 'desc': 'Math.sqrt() 函数返回一个数的平方根,即:'
142 | }, {
143 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/tan',
144 | 'text': 'Math.tan()',
145 | 'desc': 'Math.tan() 方法返回一个数值的正切值。'
146 | }, {
147 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/tanh',
148 | 'text': 'Math.tanh()',
149 | 'desc': 'Math.tanh() 函数将会返回一个数的双曲正切函数值,计算如下:'
150 | }, {
151 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc',
152 | 'text': 'Math.trunc()',
153 | 'desc': 'Math.trunc() 方法会将数字的小数部分去掉,只保留整数部分。'
154 | }
155 | ]
--------------------------------------------------------------------------------
/src/data/js/js-number.ts:
--------------------------------------------------------------------------------
1 | export default [
2 | {
3 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON',
4 | 'text': 'Number.EPSILON',
5 | 'desc': 'Number.EPSILON 属性表示 1 和大于 1 的最小的浮点数(可表示为 Number)的差值。'
6 | }, {
7 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER',
8 | 'text': 'Number.MAX_SAFE_INTEGER',
9 | 'desc': 'Number.MAX_SAFE_INTEGER 常量表示在 JavaScript 中最大的安全整数(maxinum safe integer)(253 - 1)。'
10 | }, {
11 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE',
12 | 'text': 'Number.MAX_VALUE',
13 | 'desc': 'Number.MAX_VALUE 属性表示在 JavaScript 里所能表示的最大数值。'
14 | }, {
15 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER',
16 | 'text': 'Number.MIN_SAFE_INTEGER',
17 | 'desc': 'Number.MIN_SAFE_INTEGER 代表在 JavaScript中最小的安全的integer型数字 (-(253 - 1)).'
18 | }, {
19 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE',
20 | 'text': 'Number.MIN_VALUE',
21 | 'desc': 'Number.MIN_VALUE 属性表示在 JavaScript 中所能表示的最小的正值。'
22 | }, {
23 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY',
24 | 'text': 'Number.NEGATIVE_INFINITY',
25 | 'desc': 'Number.NEGATIVE_INFINITY 属性表示负无穷大。'
26 | }, {
27 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN',
28 | 'text': 'Number.NaN',
29 | 'desc': 'Number.NaN 表示“非数字”(Not-A-Number)。和 NaN 相同。'
30 | }, {
31 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/POSITIVE_INFINITY',
32 | 'text': 'Number.POSITIVE_INFINITY',
33 | 'desc': 'Number.POSITIVE_INFINITY 属性表示正无穷大。'
34 | }, {
35 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite',
36 | 'text': 'Number.isFinite()',
37 | 'desc': 'Number.isFinite() 方法用来检测传入的参数是否是一个有穷数(finite number)。'
38 | }, {
39 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger',
40 | 'text': 'Number.isInteger()',
41 | 'desc': 'Number.isInteger() 方法用来判断给定的参数是否为整数。'
42 | }, {
43 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN',
44 | 'text': 'Number.isNaN()',
45 | 'desc': 'Number.isNaN() 方法确定传递的值是否为 NaN和其类型是 Number。它是原始的全局isNaN()的更强大的版本。'
46 | }, {
47 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger',
48 | 'text': 'Number.isSafeInteger()',
49 | 'desc': 'Number.isSafeInteger() 方法用来判断传入的参数值是否是一个“安全整数”(safe integer)。一个安全整数是一个符合下面条件的整数:'
50 | }, {
51 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/parseFloat',
52 | 'text': 'Number.parseFloat()',
53 | 'desc': 'Number.parseFloat() 方法可以把一个字符串解析成浮点数。该方法与全局的 parseFloat() 函数相同,并且处于 ECMAScript 6 规范中(用于全局变量的模块化)。'
54 | }, {
55 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/parseInt',
56 | 'text': 'Number.parseInt()',
57 | 'desc': 'Number.parseInt() 方法可以根据给定的进制数把一个字符串解析成整数。'
58 | }, {
59 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential',
60 | 'text': 'toExponential()',
61 | 'desc': 'toExponential() 方法以指数表示法返回该数值字符串表示形式。'
62 | }, {
63 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed',
64 | 'text': 'toFixed()',
65 | 'desc': 'toFixed() 方法使用定点表示法来格式化一个数。'
66 | }, {
67 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString',
68 | 'text': 'toLocaleString()',
69 | 'desc': 'toLocaleString() 方法返回这个数字在特定语言环境下的表示字符串。'
70 | }, {
71 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision',
72 | 'text': 'toPrecision()',
73 | 'desc': 'toPrecision() 方法以指定的精度返回该数值对象的字符串表示。'
74 | }, {
75 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/toSource',
76 | 'text': 'toSource()',
77 | 'desc': 'toSource() 方法返回该对象源码的字符串表示。'
78 | }, {
79 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/toString',
80 | 'text': 'toString()',
81 | 'desc': 'toString() 方法返回指定 Number 对象的字符串表示形式。'
82 | }, {
83 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/valueOf',
84 | 'text': 'valueOf()',
85 | 'desc': 'valueOf() 方法返回一个被 Number 对象包装的原始值。'
86 | }, {
87 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/toInteger',
88 | 'text': 'Number.toInteger()',
89 | 'desc': 'Number.toInteger() 用来将参数转换成整数,但该方法的实现已被移除.'
90 | }
91 | ]
--------------------------------------------------------------------------------
/src/data/js/js-object.ts:
--------------------------------------------------------------------------------
1 | export default [
2 | {
3 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/assign',
4 | 'text': 'Object.assign()',
5 | 'desc': 'Object.assign() 方法用于将所有可枚举属性的值从一个或多个源对象复制到目标对象。它将返回目标对象。'
6 | }, {
7 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/create',
8 | 'text': 'Object.create()',
9 | 'desc': 'Object.create()方法创建一个新对象,使用现有的对象来提供新创建的对象的__proto__。 (请查看浏览器控制台以获取视觉证据。)'
10 | }, {
11 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperties',
12 | 'text': 'Object.defineProperties()',
13 | 'desc': 'Object.defineProperties() 方法直接在一个对象上定义新的属性或修改现有属性,并返回该对象。'
14 | }, {
15 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty',
16 | 'text': 'Object.defineProperty()',
17 | 'desc': 'Object.defineProperty() 方法会直接在一个对象上定义一个新属性,或者修改一个对象的现有属性, 并返回这个对象。'
18 | }, {
19 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/entries',
20 | 'text': 'Object.entries()',
21 | 'desc': 'The source for this interactive example is stored in a GitHub repository. If you\'d like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.'
22 | }, {
23 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze',
24 | 'text': 'Object.freeze()',
25 | 'desc': 'Object.freeze() 方法可以冻结一个对象,冻结指的是不能向这个对象添加新的属性,不能修改其已有属性的值,不能删除已有属性,以及不能修改该对象已有属性的可枚举性、可配置性、可写性。也就是说,这个对象永远是不可变的。该方法返回被冻结的对象。'
26 | }, {
27 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/getNotifier',
28 | 'text': 'Object.getNotifier()',
29 | 'desc': 'Object.getNotifer() 方法用于创建可人工触发 change 事件的对象,但该方法在浏览器中已被废弃。'
30 | }, {
31 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor',
32 | 'text': 'Object.getOwnPropertyDescriptor()',
33 | 'desc': 'Object.getOwnPropertyDescriptor() 方法返回指定对象上一个自有属性对应的属性描述符。(自有属性指的是直接赋予该对象的属性,不需要从原型链上进行查找的属性)'
34 | }, {
35 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptors',
36 | 'text': 'Object.getOwnPropertyDescriptors()',
37 | 'desc': 'Object.getOwnPropertyDescriptors() 方法用来获取一个对象的所有自身属性的描述符。'
38 | }, {
39 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames',
40 | 'text': 'Object.getOwnPropertyNames()',
41 | 'desc': 'Object.getOwnPropertyNames()方法返回一个由指定对象的所有自身属性的属性名(包括不可枚举属性但不包括Symbol值作为名称的属性)组成的数组。'
42 | }, {
43 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertySymbols',
44 | 'text': 'Object.getOwnPropertySymbols()',
45 | 'desc': 'Object.getOwnPropertySymbols() 方法返回一个给定对象自身的所有 Symbol 属性的数组。'
46 | }, {
47 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/GetPrototypeOf',
48 | 'text': 'Object.getPrototypeOf()',
49 | 'desc': 'Object.getPrototypeOf() 方法返回指定对象的原型(内部[[Prototype]]属性的值)。'
50 | }, {
51 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/is',
52 | 'text': 'Object.is()',
53 | 'desc': 'Object.is()方法判断两个值是否是相同的值。'
54 | }, {
55 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible',
56 | 'text': 'Object.isExtensible()',
57 | 'desc': 'Object.isExtensible() 方法判断一个对象是否是可扩展的(是否可以在它上面添加新的属性)。'
58 | }, {
59 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen',
60 | 'text': 'Object.isFrozen()',
61 | 'desc': 'Object.isFrozen()方法判断一个对象是否被冻结。'
62 | }, {
63 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed',
64 | 'text': 'Object.isSealed()',
65 | 'desc': 'Object.isSealed() 方法判断一个对象是否被密封。'
66 | }, {
67 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/keys',
68 | 'text': 'Object.keys()',
69 | 'desc': 'Object.keys() 方法会返回一个由一个给定对象的自身可枚举属性组成的数组,数组中属性名的排列顺序和使用 for...in 循环遍历该对象时返回的顺序一致 。'
70 | }, {
71 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/observe',
72 | 'text': 'Object.observe()',
73 | 'desc': 'Object.observe() 方法用于异步地监视一个对象的修改。当对象属性被修改时,方法的回调函数会提供一个有序的修改流。然而,这个接口已经被废弃并从各浏览器中移除。你可以使用更通用的 Proxy 对象替代。'
74 | }, {
75 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/preventExtensions',
76 | 'text': 'Object.preventExtensions()',
77 | 'desc': 'Object.preventExtensions()方法让一个对象变的不可扩展,也就是永远不能再添加新的属性。'
78 | }, {
79 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/eval',
80 | 'text': 'eval()',
81 | 'desc': 'Object.eval() 方法用于在对象的上下文中对 JavaScript 代码字符串求值,但该方法已被移除。'
82 | }, {
83 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty',
84 | 'text': 'hasOwnProperty()',
85 | 'desc': 'hasOwnProperty() 方法会返回一个布尔值,指示对象自身属性中是否具有指定的属性'
86 | }, {
87 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/isPrototypeOf',
88 | 'text': 'isPrototypeOf()',
89 | 'desc': 'isPrototypeOf() 方法用于测试一个对象是否存在于另一个对象的原型链上。'
90 | }, {
91 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/propertyIsEnumerable',
92 | 'text': 'propertyIsEnumerable()',
93 | 'desc': 'propertyIsEnumerable() 方法返回一个布尔值,表示指定的属性是否可枚举。'
94 | }, {
95 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/toLocaleString',
96 | 'text': 'toLocaleString()',
97 | 'desc': 'toLocaleString() 方法返回一个该对象的字符串表示。此方法被用于派生对象为了特定语言环境的目的(locale-specific purposes)而重载使用。'
98 | }, {
99 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/toSource',
100 | 'text': 'toSource()',
101 | 'desc': 'toSource()方法返回一个表示对象源代码的字符串。'
102 | }, {
103 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/toString',
104 | 'text': 'toString()',
105 | 'desc': 'toString() 方法返回一个表示该对象的字符串。'
106 | }, {
107 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/unwatch',
108 | 'text': 'unwatch()',
109 | 'desc': 'unwatch() 删除一个 watch() 设置的 watchpoint.'
110 | }, {
111 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf',
112 | 'text': 'valueOf()',
113 | 'desc': 'valueOf() 方法返回指定对象的原始值。'
114 | }, {
115 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/watch',
116 | 'text': 'watch()',
117 | 'desc': ''
118 | }, {
119 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/seal',
120 | 'text': 'Object.seal()',
121 | 'desc': 'The source for this interactive example is stored in a GitHub repository. If you\'d like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.'
122 | }, {
123 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf',
124 | 'text': 'Object.setPrototypeOf()',
125 | 'desc': '如果对象的[[Prototype]]被修改成不可扩展(通过 Object.isExtensible()查看),就会抛出 TypeError异常。如果prototype参数不是一个对象或者null(例如,数字,字符串,boolean,或者 undefined),则什么都不做。否则,该方法将obj的[[Prototype]]修改为新的值。'
126 | }, {
127 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/unobserve',
128 | 'text': 'Object.unobserve()',
129 | 'desc': 'Object.unobserve() 是用来移除通过 Object.observe()设置的观察者的方法。'
130 | }, {
131 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/values',
132 | 'text': 'Object.values()',
133 | 'desc': 'Object.values()方法返回一个给定对象自己的所有可枚举属性值的数组,值的顺序与使用for...in循环的顺序相同 ( 区别在于 for-in 循环枚举原型链中的属性 )。'
134 | }, {
135 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Function/apply',
136 | 'text': 'apply()',
137 | 'desc': 'apply() 方法调用一个函数, 其具有一个指定的this值,以及作为一个数组(或类似数组的对象)提供的参数。'
138 | }, {
139 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Function/bind',
140 | 'text': 'bind()',
141 | 'desc': 'bind()方法创建一个新的函数, 当被调用时,将其this关键字设置为提供的值,在调用新函数时,在任何提供之前提供一个给定的参数序列。'
142 | }, {
143 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Function/call',
144 | 'text': 'call()',
145 | 'desc': 'call() 方法调用一个函数, 其具有一个指定的this值和分别地提供的参数(参数的列表)。'
146 | }, {
147 | 'url': 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Function/isGenerator',
148 | 'text': 'isGenerator()',
149 | 'desc': '判断一个函数是否是一个生成器.'
150 | }
151 | ]
--------------------------------------------------------------------------------
/src/data/js/js-promise.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | export default [
3 | {
4 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise/all",
5 | "text": "Promise.all()",
6 | "desc": "Promise.all(iterable) 方法返回一个 Promise 实例,此实例在 iterable 参数内所有的 promise 都“完成(resolved)”或参数中不包含 promise 时回调完成(resolve);如果参数中 promise 有一个失败(rejected),此实例回调失败(reject),失败原因的是第一个失败 promise 的结果。"
7 | },
8 | {
9 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled",
10 | "text": "Promise.allSettled()",
11 | "desc": "该Promise.allSettled()方法返回一个在所有给定的promise已被决议或被拒绝后决议的promise,并带有一个对象数组,每个对象表示对应的promise结果。"
12 | },
13 | {
14 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise/any",
15 | "text": "Promise.any()",
16 | "desc": "Promise.any() 接收一个Promise可迭代对象,只要其中的一个 promise 完成,就返回那个已经有完成值的 promise 。如果可迭代对象中没有一个 promise 完成(即所有的 promises 都失败/拒绝),就返回一个拒绝的 promise,返回值还有待商榷:无非是拒绝原因数组或AggregateError类型的实例,它是 Error 的一个子类,用于把单一的错误集合在一起。本质上,这个方法和Promise.all()是相反的。"
17 | },
18 | {
19 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch",
20 | "text": "Promise.prototype.catch()",
21 | "desc": "catch() 方法返回一个Promise,并且处理拒绝的情况。它的行为与调用Promise.prototype.then(undefined, onRejected) 相同。 (事实上, calling obj.catch(onRejected) 内部calls obj.then(undefined, onRejected))."
22 | },
23 | {
24 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise/finally",
25 | "text": "Promise.prototype.finally()",
26 | "desc": "返回一个设置了 finally 回调函数的Promise对象。"
27 | },
28 | {
29 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise/then",
30 | "text": "Promise.prototype.then()",
31 | "desc": "then() 方法返回一个 Promise。它最多需要有两个参数:Promise 的成功和失败情况的回调函数。"
32 | },
33 | {
34 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise/race",
35 | "text": "Promise.race()",
36 | "desc": "Promise.race(iterable) 方法返回一个 promise,一旦迭代器中的某个promise解决或拒绝,返回的 promise就会解决或拒绝。"
37 | },
38 | {
39 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject",
40 | "text": "Promise.reject()",
41 | "desc": "Promise.reject()方法返回一个带有拒绝原因的Promise对象。"
42 | },
43 | {
44 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve",
45 | "text": "Promise.resolve()",
46 | "desc": "The source for this interactive demo is stored in a GitHub repository. If you'd like to contribute to the interactive demo project, please clone https://github.com/mdn/interactive-examples and send us a pull request."
47 | }
48 | ]
49 | /* eslint-disable */
--------------------------------------------------------------------------------
/src/data/js/js-string.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 |
3 | export default [
4 | {
5 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode",
6 | "desc": "静态 String.fromCharCode() 方法返回由指定的UTF-16代码单元序列创建的字符串。",
7 | "text": "String.fromCharCode()"
8 | },
9 | {
10 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint",
11 | "desc": "String.fromCodePoint() 静态方法返回使用指定的代码点序列创建的字符串。",
12 | "text": "String.fromCodePoint()"
13 | },
14 | {
15 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/charAt",
16 | "desc": "charAt() 方法从一个字符串中返回指定的字符。",
17 | "text": "charAt()"
18 | },
19 | {
20 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt",
21 | "desc": "charCodeAt() 方法返回0到65535之间的整数,表示给定索引处的UTF-16代码单元 (在 Unicode 编码单元表示一个单一的 UTF-16 编码单元的情况下,UTF-16 编码单元匹配 Unicode 编码单元。但在——例如 Unicode 编码单元 > 0x10000 的这种——不能被一个 UTF-16 编码单元单独表示的情况下,只能匹配 Unicode 代理对的第一个编码单元) 。如果你想要整个代码点的值,使用 codePointAt()。",
22 | "text": "charCodeAt()"
23 | },
24 | {
25 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt",
26 | "desc": "codePointAt() 方法返回 一个 Unicode 编码点值的非负整数。",
27 | "text": "codePointAt()"
28 | },
29 | {
30 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/concat",
31 | "desc": "concat() 方法将一个或多个字符串与原字符串连接合并,形成一个新的字符串并返回。",
32 | "text": "concat()"
33 | },
34 | {
35 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith",
36 | "desc": "endsWith()方法用来判断当前字符串是否是以另外一个给定的子字符串“结尾”的,根据判断结果返回 true 或 false。",
37 | "text": "endsWith()"
38 | },
39 | {
40 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/includes",
41 | "desc": "includes() 方法用于判断一个字符串是否包含在另一个字符串中,根据情况返回 true 或 false。",
42 | "text": "includes()"
43 | },
44 | {
45 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf",
46 | "desc": "indexOf() 方法返回调用它的 String 对象中第一次出现的指定值的索引,从 fromIndex 处进行搜索。如果未找到该值,则返回 -1。",
47 | "text": "indexOf()"
48 | },
49 | {
50 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf",
51 | "desc": "lastIndexOf() 方法返回指定值在调用该方法的字符串中最后出现的位置,如果没找到则返回 -1。length为需要检索字符串的长度,默认值为str.length。",
52 | "text": "lastIndexOf()"
53 | },
54 | {
55 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare",
56 | "desc": "localeCompare() 方法返回一个数字来指示一个参考字符串是否在排序顺序前面或之后或与给定字符串相同。",
57 | "text": "localeCompare()"
58 | },
59 | {
60 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/match",
61 | "desc": "match() 方法检索返回一个字符串匹配正则表达式的的结果。",
62 | "text": "match()"
63 | },
64 | {
65 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/matchAll",
66 | "desc": "matchAll() 方法返回一个包含所有匹配正则表达式及分组捕获结果的迭代器。",
67 | "text": "matchAll()"
68 | },
69 | {
70 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/normalize",
71 | "desc": "normalize() 方法会按照指定的一种 Unicode 正规形式将当前字符串正规化.",
72 | "text": "normalize()"
73 | },
74 | {
75 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd",
76 | "desc": "padEnd() 方法会用一个字符串填充当前字符串(如果需要的话则重复填充),返回填充后达到指定长度的字符串。从当前字符串的末尾(右侧)开始填充。",
77 | "text": "padEnd()"
78 | },
79 | {
80 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/padStart",
81 | "desc": "padStart() 方法用另一个字符串填充当前字符串(重复,如果需要的话),以便产生的字符串达到给定的长度。填充从当前字符串的开始(左侧)应用的。",
82 | "text": "padStart()"
83 | },
84 | {
85 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/repeat",
86 | "desc": "repeat() 构造并返回一个新字符串,该字符串包含被连接在一起的指定数量的字符串的副本。",
87 | "text": "repeat()"
88 | },
89 | {
90 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/replace",
91 | "desc": "replace() 方法返回一个由替换值(replacement)替换一些或所有匹配的模式(pattern)后的新字符串。模式可以是一个字符串或者一个正则表达式,替换值可以是一个字符串或者一个每次匹配都要调用的回调函数。",
92 | "text": "replace()"
93 | },
94 | {
95 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/search",
96 | "desc": "search() 方法执行正则表达式和 String 对象之间的一个搜索匹配。",
97 | "text": "search()"
98 | },
99 | {
100 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/slice",
101 | "desc": "slice() 方法提取某个字符串的一部分,并返回一个新的字符串,且不会改动原字符串。",
102 | "text": "slice()"
103 | },
104 | {
105 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/split",
106 | "desc": "split() 方法使用指定的分隔符字符串将一个String对象分割成字符串数组,以将字符串分隔为子字符串,以确定每个拆分的位置。",
107 | "text": "split()"
108 | },
109 | {
110 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith",
111 | "desc": "startsWith() 方法用来判断当前字符串是否以另外一个给定的子字符串开头,并根据判断结果返回 true 或 false。",
112 | "text": "startsWith()"
113 | },
114 | {
115 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/substring",
116 | "desc": "substring() 方法返回一个字符串在开始索引到结束索引之间的一个子集, 或从开始索引直到字符串的末尾的一个子集。",
117 | "text": "substring()"
118 | },
119 | {
120 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleLowerCase",
121 | "desc": "toLocaleLowerCase()方法根据任何特定于语言环境的案例映射,返回调用字符串值转换为小写的值。",
122 | "text": "toLocaleLowerCase()"
123 | },
124 | {
125 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase",
126 | "desc": "toLocaleUpperCase() 使用本地化(locale-specific)的大小写映射规则将输入的字符串转化成大写形式并返回结果字符串。",
127 | "text": "toLocaleUpperCase()"
128 | },
129 | {
130 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase",
131 | "desc": "toLowerCase() 会将调用该方法的字符串值转为小写形式,并返回。",
132 | "text": "toLowerCase()"
133 | },
134 | {
135 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/toString",
136 | "desc": "toString() 方法返回指定对象的字符串形式。",
137 | "text": "toString()"
138 | },
139 | {
140 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase",
141 | "desc": "toUpperCase() 将调用该方法的字符串值转换为大写形式,并返回。",
142 | "text": "toUpperCase()"
143 | },
144 | {
145 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/Trim",
146 | "desc": "trim() 方法会从一个字符串的两端删除空白字符。在这个上下文中的空白字符是所有的空白字符 (space, tab, no-break space 等) 以及所有行终止符字符(如 LF,CR)。",
147 | "text": "trim()"
148 | },
149 | {
150 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/TrimRight",
151 | "desc": "trimRight() 方法从一个字符串的右端移除空白字符。",
152 | "text": "trimRight()"
153 | },
154 | {
155 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/TrimLeft",
156 | "desc": "一个新字符串,表示从其开头(左端)剥离空格的调用字符串。",
157 | "text": "trimLeft()"
158 | },
159 | {
160 | "url": "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/raw",
161 | "desc": "String.raw() 是一个模板字符串的标签函数,它的作用类似于 Python 中的字符串前缀 r 和 C# 中的字符串前缀 @(还是有点区别的,详见隔壁 Chromium 那边的这个 issue),是用来获取一个模板字符串的原始字符串的,比如说,占位符(例如 ${foo})会被处理为它所代表的其他字符串,而转义字符(例如 \\n)不会。",
162 | "text": "String.raw()"
163 | }
164 | ]
165 |
166 | /* eslint-disable */
--------------------------------------------------------------------------------
/src/data/js/js-words.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 |
3 | export default [
4 | {
5 | "text": "abort",
6 | "desc": `
7 | [ə'bɔːt]:
8 | 退出、舍弃
9 | `},
10 |
11 | {
12 | "text": "abstract",
13 | "desc": `
14 | ['æbstrækt]:
15 | 抽象
16 | `},
17 |
18 | {
19 | "text": "acknowledge",
20 | "desc": `
21 | [əkˈnɒlɪdʒ]:
22 | 确认、告知已收到
23 | `},
24 |
25 | {
26 | "text": "accept",
27 | "desc": `
28 | [əkˈsept]:
29 | 接收、接受
30 | `},
31 |
32 | {
33 | "text": "advance",
34 | "desc": `
35 | [əd'vɑːns]:
36 | 高级、前进
37 | `},
38 |
39 | {
40 | "text": "adapter",
41 | "desc": `
42 | [ə'dæptə]:
43 | 适配器
44 | `},
45 |
46 | {
47 | "text": "ahead",
48 | "desc": `
49 | [ə'hed]:
50 | 先、提前的
51 | `},
52 |
53 | {
54 | "text": "alias",
55 | "desc": `
56 | [ˈeɪliəs]:
57 | 别名
58 | `},
59 |
60 | {
61 | "text": "arrow",
62 | "desc": `
63 | ['ærəʊ]:
64 | 箭头
65 | `},
66 |
67 | {
68 | "text": "assemble",
69 | "desc": `
70 | [ə'semb(ə)l]:
71 | 集合、组合
72 | `},
73 |
74 | {
75 | "text": "assign",
76 | "desc": `
77 | [ə'saɪn]:
78 | 赋值、分配
79 | `},
80 |
81 | {
82 | "text": "asynchronous",
83 | "desc": `
84 | [e'sɪŋkrənəs]:
85 | 异步的
86 | `},
87 |
88 | {
89 | "text": "attempt",
90 | "desc": `
91 | [ə'tem(p)t]:
92 | 尝试
93 | `},
94 |
95 | {
96 | "text": "attach",
97 | "desc": `
98 | [ə'tætʃ]:
99 | 连接、附加
100 | `},
101 |
102 | {
103 | "text": "authorize",
104 | "desc": `
105 | ['ɔθəraɪz]:
106 | 授权、批准
107 | `},
108 |
109 | {
110 | "text": "authenticate",
111 | "desc": `
112 | [ɔː'θentɪkeɪt]:
113 | 认证
114 | `},
115 |
116 | {
117 | "text": "automatic",
118 | "desc": `
119 | [ɔːtə'mætɪk]:
120 | 自动
121 | `},
122 |
123 | {
124 | "text": "average",
125 | "desc": `
126 | ['æv(ə)rɪdʒ]:
127 | 平均、普通
128 | `},
129 |
130 |
131 | {
132 | "text": "bearer",
133 | "desc": `
134 | [ˈberər]:
135 | 送信人、搬运工人
136 | `},
137 |
138 | {
139 | "text": "behavior",
140 | "desc": `
141 | [bɪˈheɪvjə]:
142 | 行为、做法
143 | `},
144 |
145 | {
146 | "text": "boot",
147 | "desc": `
148 | [buːt]:
149 | 启动
150 | `},
151 |
152 | {
153 | "text": "bootstrap",
154 | "desc": `
155 | ['buːtstræp]:
156 | 引导程序
157 | `},
158 |
159 | {
160 | "text": "bridge",
161 | "desc": `
162 | [brɪdʒ]:
163 | 桥、桥接器
164 | `},
165 |
166 | {
167 | "text": "broadcast",
168 | "desc": `
169 | ['brɔːdkɑːst]:
170 | 广播、播送
171 | `},
172 |
173 | {
174 | "text": "browser",
175 | "desc": `
176 | ['braʊzə]:
177 | 浏览器
178 | `},
179 |
180 | {
181 | "text": "bound",
182 | "desc": `
183 | [baʊnd]:
184 | 边界
185 | `},
186 |
187 |
188 | {
189 | "text": "catch",
190 | "desc": `
191 | [kætʃ]:
192 | 捕获、捕捉
193 | `},
194 |
195 | {
196 | "text": "category",
197 | "desc": `
198 | ['kætəɡɔri]:
199 | 类别、种类
200 | `},
201 |
202 | {
203 | "text": "cause",
204 | "desc": `
205 | [kɔːz]:
206 | 原因、导致
207 | `},
208 |
209 | {
210 | "text": "capture",
211 | "desc": `
212 | ['kæptʃə]:
213 | 捕捉、捕获
214 | `},
215 |
216 | {
217 | "text": "certificate",
218 | "desc": `
219 | [səˈtɪfɪˌkeɪt]:
220 | 证书、凭证
221 | `},
222 |
223 | {
224 | "text": "charset",
225 | "desc": `
226 | [tʃɑˈset]:
227 | 字符集
228 | `},
229 |
230 | {
231 | "text": "chart",
232 | "desc": `
233 | [tʃɑːt]:
234 | 图表、图
235 | `},
236 |
237 | {
238 | "text": "cover",
239 | "desc": `
240 | ['kʌvə]:
241 | 覆盖
242 | `},
243 |
244 | {
245 | "text": "column",
246 | "desc": `
247 | ['kɒləm]:
248 | 列
249 | `},
250 |
251 | {
252 | "text": "command",
253 | "desc": `
254 | [kə'mɑːnd]:
255 | 命令、指令
256 | `},
257 |
258 | {
259 | "text": "commit",
260 | "desc": `
261 | [kə'mɪt]:
262 | 提交、犯罪
263 | `},
264 |
265 | {
266 | "text": "comment",
267 | "desc": `
268 | ['kɒment]:
269 | 评论、注解、议论
270 | `},
271 |
272 | {
273 | "text": "compare",
274 | "desc": `
275 | [kəm'peə]:
276 | 对比、比较
277 | `},
278 |
279 | {
280 | "text": "compile",
281 | "desc": `
282 | [kəm'paɪl]:
283 | 汇编、编译
284 | `},
285 |
286 | {
287 | "text": "compose",
288 | "desc": `
289 | [kəm'pəʊz]:
290 | 组合、组成
291 | `},
292 |
293 | {
294 | "text": "component",
295 | "desc": `
296 | [kəm'pəʊnənt]:
297 | 组件、元件
298 | `},
299 |
300 | {
301 | "text": "complete",
302 | "desc": `
303 | [kəm'pliːt]:
304 | 完成、完整的
305 | `},
306 |
307 | {
308 | "text": "compress",
309 | "desc": `
310 | [kəm'pres]:
311 | 压缩
312 | `},
313 |
314 | {
315 | "text": "constraint",
316 | "desc": `
317 | [kən'streɪnt]:
318 | 约束、强制
319 | `},
320 |
321 | {
322 | "text": "conflict",
323 | "desc": `
324 | [ˈkɒnflɪkt]:
325 | 冲突
326 | `},
327 |
328 | {
329 | "text": "constructor",
330 | "desc": `
331 | [kənˈstrʌktə(r)]:
332 | 构造函数、构造器
333 | `},
334 |
335 | {
336 | "text": "context",
337 | "desc": `
338 | ['kɒntekst]:
339 | 上下文、环境
340 | `},
341 |
342 | {
343 | "text": "contain",
344 | "desc": `
345 | [kənˈteɪn]:
346 | 包含
347 | `},
348 |
349 | {
350 | "text": "convert",
351 | "desc": `
352 | [kən'vɜːt]:
353 | 变、变换、兑换
354 | `},
355 |
356 |
357 | {
358 | "text": "decoration",
359 | "desc": `
360 | [dekə'reɪʃ(ə)n]:
361 | 装饰
362 | `},
363 |
364 | {
365 | "text": "dependencies",
366 | "desc": `
367 | [dɪ'pɛndənsi]:
368 | 依赖
369 | `},
370 |
371 | {
372 | "text": "define",
373 | "desc": `
374 | [dɪ'faɪn]:
375 | 定义
376 | `},
377 |
378 | {
379 | "text": "defer",
380 | "desc": `
381 | [dɪ'fɜː]:
382 | 延缓、推迟
383 | `},
384 |
385 | {
386 | "text": "decoration",
387 | "desc": `
388 | [dekə'reɪʃ(ə)n]:
389 | 装饰
390 | `},
391 |
392 | {
393 | "text": "declare",
394 | "desc": `
395 | [dɪˈkler]:
396 | 声明
397 | `},
398 |
399 | {
400 | "text": "decorator",
401 | "desc": `
402 | [ˈdekəreɪtər]:
403 | 装饰者
404 | `},
405 |
406 | {
407 | "text": "device",
408 | "desc": `
409 | [dɪ'vaɪs]:
410 | 设备
411 | `},
412 |
413 | {
414 | "text": "distribute",
415 | "desc": `
416 | ['dɪstrɪbjuːt]:
417 | 分发、分配
418 | `},
419 |
420 | {
421 | "text": "drive",
422 | "desc": `
423 | [draɪv]:
424 | 驱动、驾驶
425 | `},
426 |
427 | {
428 | "text": "document",
429 | "desc": `
430 | ['dɒkjʊm(ə)nt]:
431 | 文档、文件
432 | `},
433 |
434 |
435 | {
436 | "text": "explicitly",
437 | "desc": `
438 | [ɪkˈsplɪsɪtli]:
439 | 明确地
440 | `},
441 |
442 | {
443 | "text": "effect",
444 | "desc": `
445 | [ɪ'fekt]:
446 | 影响、效果、作用
447 | `},
448 |
449 | {
450 | "text": "efficient",
451 | "desc": `
452 | [ɪ'fɪʃnt]:
453 | 高效
454 | `},
455 |
456 | {
457 | "text": "emulator",
458 | "desc": `
459 | ['emjʊleɪtə]:
460 | 模拟器
461 | `},
462 |
463 | {
464 | "text": "execute",
465 | "desc": `
466 | ['eksɪkjuːt]:
467 | 执行
468 | `},
469 |
470 | {
471 | "text": "explore",
472 | "desc": `
473 | [ɪk'splɔr]:
474 | 探索
475 | `},
476 |
477 | {
478 | "text": "evaluate",
479 | "desc": `
480 | [ɪˈvæljueɪt]:
481 | 求…的值、估价
482 | `},
483 |
484 | {
485 | "text": "export",
486 | "desc": `
487 | [ˈekspɔːt]:
488 | 出口、输出
489 | `},
490 |
491 | {
492 | "text": "expose",
493 | "desc": `
494 | [ɪkˈspəʊz]:
495 | 暴露、显示
496 | `},
497 |
498 | {
499 | "text": "expression",
500 | "desc": `
501 | [ɪkˈspreʃn]:
502 | 表达式、表达、词句
503 | `},
504 |
505 | {
506 | "text": "extract",
507 | "desc": `
508 | [ˈekstrækt]:
509 | 提取、抽出
510 | `},
511 |
512 | {
513 | "text": "extends",
514 | "desc": `
515 | [ɪk'stendz]:
516 | 继承、延伸
517 | `},
518 |
519 | {
520 | "text": "external",
521 | "desc": `
522 | [ekˈstərnəl]:
523 | 外部的
524 | `},
525 |
526 | {
527 | "text": "electron",
528 | "desc": `
529 | [ɪ'lektrɒn]:
530 | 电子
531 | `},
532 |
533 | {
534 | "text": "evaluate",
535 | "desc": `
536 | [ɪ'væljʊeɪt]:
537 | 评估
538 | `},
539 |
540 | {
541 | "text": "explain",
542 | "desc": `
543 | [ɪk'spleɪn]:
544 | 解释、说明
545 | `},
546 |
547 | {
548 | "text": "emit",
549 | "desc": `
550 | [ɪ'mɪt]:
551 | 发射
552 | `},
553 |
554 | {
555 | "text": "emoji",
556 | "desc": `
557 | [ēˈmōjē]:
558 | 表情符号
559 | `},
560 |
561 |
562 | {
563 | "text": "forbidden",
564 | "desc": `
565 | [fə'bɪd(ə)n]:
566 | 被禁止的
567 | `},
568 |
569 | {
570 | "text": "forgery",
571 | "desc": `
572 | [ˈfɔːdʒəri]:
573 | 伪造
574 | `},
575 |
576 | {
577 | "text": "fragment",
578 | "desc": `
579 | ['frægmənt]:
580 | 碎片、片段
581 | `},
582 |
583 |
584 |
585 | {
586 | "text": "gateway",
587 | "desc": `
588 | ['geɪtweɪ]:
589 | 网关、出入口
590 | `},
591 |
592 | {
593 | "text": "generate",
594 | "desc": `
595 | ['dʒenəreɪt]:
596 | 生成
597 | `},
598 |
599 | {
600 | "text": "graph",
601 | "desc": `
602 | [græf]:
603 | 图形、图表
604 | `},
605 |
606 |
607 | {
608 | "text": "handle",
609 | "desc": `
610 | ['hænd(ə)l]:
611 | 处理、把手
612 | `},
613 |
614 | {
615 | "text": "horizontal",
616 | "desc": `
617 | [hɒrɪ'zɒnt(ə)l]:
618 | 水平、横
619 | `},
620 |
621 | {
622 | "text": "hour",
623 | "desc": `
624 | ['aʊə]:
625 | 小时
626 | `},
627 |
628 | {
629 | "text": "highlight",
630 | "desc": `
631 | ['haɪlaɪt]:
632 | 高亮、突出
633 | `},
634 |
635 | {
636 | "text": "hybrid",
637 | "desc": `
638 | ['haɪbrɪd]:
639 | 混合
640 | `},
641 |
642 |
643 | {
644 | "text": "identifier",
645 | "desc": `
646 | [aɪˈdentɪfaɪə(r)]:
647 | 标识符
648 | `},
649 |
650 | {
651 | "text": "iterator",
652 | "desc": `
653 | [ɪtə'reɪtə]:
654 | 迭代器
655 | `},
656 |
657 | {
658 | "text": "immutable",
659 | "desc": `
660 | [ɪ'mjuːtəb(ə)l]:
661 | 不可变的
662 | `},
663 |
664 | {
665 | "text": "import",
666 | "desc": `
667 | [ɪm'pɔːt]:
668 | 导入、进口
669 | `},
670 |
671 | {
672 | "text": "implement",
673 | "desc": `
674 | ['ɪmplɪm(ə)nt]:
675 | 实现、器具
676 | `},
677 |
678 | {
679 | "text": "increase",
680 | "desc": `
681 | [ɪn'kriːs]:
682 | 增加、提高
683 | `},
684 |
685 | {
686 | "text": "increment",
687 | "desc": `
688 | [ˈɪŋkrəmənt]:
689 | 增加、增量
690 | `},
691 |
692 | {
693 | "text": "index",
694 | "desc": `
695 | ['ɪndeks]:
696 | 索引
697 | `},
698 |
699 | {
700 | "text": "inject",
701 | "desc": `
702 | [ɪn'dʒekt]:
703 | 注入
704 | `},
705 |
706 | {
707 | "text": "instance",
708 | "desc": `
709 | ['ɪnst(ə)ns]:
710 | 实例
711 | `},
712 |
713 | {
714 | "text": "integer",
715 | "desc": `
716 | ['ɪntɪdʒə]:
717 | 整数
718 | `},
719 |
720 | {
721 | "text": "interaction",
722 | "desc": `
723 | [ɪntər'ækʃ(ə)n]:
724 | 交互、互动
725 | `},
726 |
727 | {
728 | "text": "interface",
729 | "desc": `
730 | [ˈɪntəfeɪs]:
731 | 接口、界面
732 | `},
733 |
734 | {
735 | "text": "inspect",
736 | "desc": `
737 | [ɪn'spekt]:
738 | 检查、察看
739 | `},
740 |
741 | {
742 | "text": "information",
743 | "desc": `
744 | [ɪnfə'meɪʃ(ə)n]:
745 | 信息
746 | `},
747 |
748 | {
749 | "text": "invoke",
750 | "desc": `
751 | [ɪn'vəʊk]:
752 | 调用
753 | `},
754 |
755 | {
756 | "text": "issue",
757 | "desc": `
758 | ['ɪʃu]:
759 | 问题
760 | `},
761 |
762 |
763 | {
764 | "text": "latest",
765 | "desc": `
766 | ['leɪtɪst]:
767 | 最新、最后
768 | `},
769 |
770 | {
771 | "text": "logic",
772 | "desc": `
773 | ['lɒdʒɪk]:
774 | 逻辑
775 | `},
776 |
777 | {
778 | "text": "manifest",
779 | "desc": `
780 | ['mænɪfest]:
781 | 清单
782 | `},
783 |
784 | {
785 | "text": "match",
786 | "desc": `
787 | [mætʃ]:
788 | 匹配、比赛
789 | `},
790 |
791 | {
792 | "text": "matrix",
793 | "desc": `
794 | ['meɪtrɪks]:
795 | 矩阵、模型
796 | `},
797 |
798 | {
799 | "text": "method",
800 | "desc": `
801 | ['meθəd]:
802 | 方法
803 | `},
804 |
805 | {
806 | "text": "meta",
807 | "desc": `
808 | ['metə]:
809 | 元
810 | `},
811 |
812 | {
813 | "text": "model",
814 | "desc": `
815 | ['mɒdl]:
816 | 模型
817 | `},
818 |
819 | {
820 | "text": "module",
821 | "desc": `
822 | ['mɒdjuːl]:
823 | 模块
824 | `},
825 |
826 | {
827 | "text": "major",
828 | "desc": `
829 | ['meɪdʒə]:
830 | 主要的
831 | `},
832 |
833 | {
834 | "text": "minor",
835 | "desc": `
836 | ['maɪnə]:
837 | 次要的
838 | `},
839 |
840 | {
841 | "text": "manual",
842 | "desc": `
843 | ['mænjʊ(ə)l]:
844 | 手工的、手册、指南
845 | `},
846 |
847 | {
848 | "text": "monitor",
849 | "desc": `
850 | ['mɒnɪtə]:
851 | 监控、显示器
852 | `},
853 |
854 | {
855 | "text": "mutation",
856 | "desc": `
857 | [mjuː'teɪʃ(ə)n]:
858 | 突变、变动
859 | `},
860 |
861 | {
862 | "text": "multiple",
863 | "desc": `
864 | ['mʌltɪpl]:
865 | 多
866 | `},
867 |
868 | {
869 | "text": "middleware",
870 | "desc": `
871 | ['midlwεə]:
872 | 中间件
873 | `},
874 |
875 | {
876 | "text": "minute",
877 | "desc": `
878 | ['mɪnɪt]:
879 | 分钟
880 | `},
881 |
882 | {
883 | "text": "observer",
884 | "desc": `
885 | [əb'zɜːvə]:
886 | 观察者
887 | `},
888 |
889 | {
890 | "text": "operator",
891 | "desc": `
892 | ['ɒpəreɪtə]:
893 | 操作者
894 | `},
895 |
896 | {
897 | "text": "output",
898 | "desc": `
899 | ['aʊtpʊt]:
900 | 输出、产量
901 | `},
902 |
903 | {
904 | "text": "owner",
905 | "desc": `
906 | [ˈəʊnə(r)]:
907 | 所有者、物主
908 | `},
909 |
910 |
911 | {
912 | "text": "package",
913 | "desc": `
914 | ['pækɪdʒ]:
915 | 包
916 | `},
917 |
918 | {
919 | "text": "pagination",
920 | "desc": `
921 | [,pædʒɪ'neɪʃ(ə)n]:
922 | 分页
923 | `},
924 |
925 | {
926 | "text": "paint",
927 | "desc": `
928 | [peɪnt]:
929 | 渲染、绘制
930 | `},
931 |
932 | {
933 | "text": "parameter",
934 | "desc": `
935 | [pə'ræmɪtə]:
936 | 参数
937 | `},
938 |
939 | {
940 | "text": "pattern",
941 | "desc": `
942 | ['pæt(ə)n]:
943 | 模式
944 | `},
945 |
946 | {
947 | "text": "perform",
948 | "desc": `
949 | [pə'fɔːm]:
950 | 执行
951 | `},
952 |
953 | {
954 | "text": "performance",
955 | "desc": `
956 | [pə'fɔːm(ə)ns]:
957 | 性能
958 | `},
959 |
960 | {
961 | "text": "permission",
962 | "desc": `
963 | [pə'mɪʃ(ə)n]:
964 | 允许、权限
965 | `},
966 |
967 | {
968 | "text": "platform",
969 | "desc": `
970 | ['plætfɔːm]:
971 | 平台
972 | `},
973 |
974 | {
975 | "text": "phase",
976 | "desc": `
977 | [feɪz]:
978 | 阶段
979 | `},
980 |
981 | {
982 | "text": "prefix",
983 | "desc": `
984 | ['priːfɪks]:
985 | 前缀、字首
986 | `},
987 |
988 | {
989 | "text": "present",
990 | "desc": `
991 | [ˈpreznt]:
992 | 现在的、目前
993 | `},
994 |
995 | {
996 | "text": "protect",
997 | "desc": `
998 | [prə'tekt]:
999 | 保护
1000 | `},
1001 |
1002 | {
1003 | "text": "prototype",
1004 | "desc": `
1005 | ['prəʊtətaɪp]:
1006 | 原型
1007 | `},
1008 |
1009 | {
1010 | "text": "program",
1011 | "desc": `
1012 | ['prəʊɡræm]:
1013 | 程序
1014 | `},
1015 |
1016 | {
1017 | "text": "process",
1018 | "desc": `
1019 | [ˈprəʊses]:
1020 | 进程、程序、过程
1021 | `},
1022 |
1023 | {
1024 | "text": "progress",
1025 | "desc": `
1026 | ['prəʊgres]:
1027 | 进展、进步
1028 | `},
1029 |
1030 | {
1031 | "text": "promise",
1032 | "desc": `
1033 | ['prɒmɪs]:
1034 | 承诺、许诺
1035 | `},
1036 |
1037 | {
1038 | "text": "provisional",
1039 | "desc": `
1040 | [prəˈvɪʒənl]:
1041 | 临时的
1042 | `},
1043 |
1044 | {
1045 | "text": "preset",
1046 | "desc": `
1047 | [priː'set]:
1048 | 预设、预置
1049 | `},
1050 |
1051 | {
1052 | "text": "prepend",
1053 | "desc": `
1054 | [pri:'pend]:
1055 | 前置、预先
1056 | `},
1057 |
1058 | {
1059 | "text": "precision",
1060 | "desc": `
1061 | [prɪ'sɪʒ(ə)n]:
1062 | 精确
1063 | `},
1064 |
1065 | {
1066 | "text": "prune",
1067 | "desc": `
1068 | [pruːn]:
1069 | 修剪、精简
1070 | `},
1071 |
1072 | {
1073 | "text": "primitive",
1074 | "desc": `
1075 | [ˈprɪmətɪv]:
1076 | 原始的
1077 | `},
1078 |
1079 | {
1080 | "text": "polyfill",
1081 | "desc": `
1082 | :
1083 | 补丁、填充工具
1084 | `},
1085 |
1086 | {
1087 | "text": "profile",
1088 | "desc": `
1089 | ['prəʊfaɪl]:
1090 | 轮廓、扼要描述
1091 | `},
1092 |
1093 | {
1094 | "text": "protocol",
1095 | "desc": `
1096 | ['prəʊtəkɒl]:
1097 | 协议
1098 | `},
1099 |
1100 | {
1101 | "text": "port",
1102 | "desc": `
1103 | [pɔːt]:
1104 | 端口、港口
1105 | `},
1106 |
1107 | {
1108 | "text": "provide",
1109 | "desc": `
1110 | [prə'vaɪd]:
1111 | 提供
1112 | `},
1113 |
1114 | {
1115 | "text": "priority",
1116 | "desc": `
1117 | [praɪˈɒrəti]:
1118 | 优先、优先权
1119 | `},
1120 |
1121 | {
1122 | "text": "private",
1123 | "desc": `
1124 | [ˈpraɪvɪt]:
1125 | 私有的
1126 | `},
1127 |
1128 | {
1129 | "text": "public",
1130 | "desc": `
1131 | ['pʌblɪk]:
1132 | 公用、公开
1133 | `},
1134 |
1135 | {
1136 | "text": "publish",
1137 | "desc": `
1138 | ['pʌblɪʃ]:
1139 | 发布、公布、出版
1140 | `},
1141 |
1142 |
1143 | {
1144 | "text": "query",
1145 | "desc": `
1146 | ['kwɪərɪ]:
1147 | 查询
1148 | `},
1149 |
1150 | {
1151 | "text": "queue",
1152 | "desc": `
1153 | [kjuː]:
1154 | 队列
1155 | `},
1156 |
1157 |
1158 | {
1159 | "text": "reactive",
1160 | "desc": `
1161 | [rɪ'æktɪv]:
1162 | 响应、反应
1163 | `},
1164 |
1165 | {
1166 | "text": "record",
1167 | "desc": `
1168 | [ˈrekɔːd]:
1169 | 记录、录音
1170 | `},
1171 |
1172 | {
1173 | "text": "rectangle/rect",
1174 | "desc": `
1175 | [ˈrektæŋɡl]:
1176 | 矩形
1177 | `},
1178 |
1179 | {
1180 | "text": "reference",
1181 | "desc": `
1182 | ['ref(ə)r(ə)ns]:
1183 | 参考、引用
1184 | `},
1185 |
1186 | {
1187 | "text": "regular",
1188 | "desc": `
1189 | [ˈreɡjələr]:
1190 | 正则
1191 | `},
1192 |
1193 | {
1194 | "text": "resolve",
1195 | "desc": `
1196 | [rɪ'zɒlv]:
1197 | 解决、解析
1198 | `},
1199 |
1200 | {
1201 | "text": "reject",
1202 | "desc": `
1203 | [rɪˈdʒɛkt]:
1204 | 拒绝
1205 | `},
1206 |
1207 | {
1208 | "text": "report",
1209 | "desc": `
1210 | [rɪ'pɔːt]:
1211 | 报告、汇报
1212 | `},
1213 |
1214 | {
1215 | "text": "related",
1216 | "desc": `
1217 | [rɪ'leɪtɪd]:
1218 | 有关
1219 | `},
1220 |
1221 | {
1222 | "text": "release",
1223 | "desc": `
1224 | [rɪ'liːs]:
1225 | 版本、发布
1226 | `},
1227 |
1228 | {
1229 | "text": "route",
1230 | "desc": `
1231 | [ruːt]:
1232 | 路由、路线
1233 | `},
1234 |
1235 |
1236 | {
1237 | "text": "scaffold",
1238 | "desc": `
1239 | ['skæfəʊld]:
1240 | 脚手架
1241 | `},
1242 |
1243 | {
1244 | "text": "second",
1245 | "desc": `
1246 | ['sek(ə)nd]:
1247 | 秒、第二
1248 | `},
1249 |
1250 | {
1251 | "text": "secure",
1252 | "desc": `
1253 | [sɪ'kjʊə]:
1254 | 安全
1255 | `},
1256 |
1257 | {
1258 | "text": "slogan",
1259 | "desc": `
1260 | ['sləʊg(ə)n]:
1261 | 口号、标语
1262 | `},
1263 |
1264 | {
1265 | "text": "snippet",
1266 | "desc": `
1267 | ['snɪpɪt]:
1268 | 片段、小片
1269 | `},
1270 |
1271 | {
1272 | "text": "syntax",
1273 | "desc": `
1274 | ['sɪntæks]:
1275 | 语法、引用
1276 | `},
1277 |
1278 | {
1279 | "text": "specification",
1280 | "desc": `
1281 | [ˌspesɪfɪˈkeɪʃn]:
1282 | 规范、规格
1283 | `},
1284 |
1285 | {
1286 | "text": "specify",
1287 | "desc": `
1288 | ['spesɪfaɪ]:
1289 | 指定、说明
1290 | `},
1291 |
1292 | {
1293 | "text": "stable",
1294 | "desc": `
1295 | ['steɪb(ə)l]:
1296 | 稳定
1297 | `},
1298 |
1299 | {
1300 | "text": "stage",
1301 | "desc": `
1302 | [steɪdʒ]:
1303 | 阶段
1304 | `},
1305 |
1306 | {
1307 | "text": "state",
1308 | "desc": `
1309 | [steɪt]:
1310 | 状态、州
1311 | `},
1312 |
1313 | {
1314 | "text": "status",
1315 | "desc": `
1316 | ['steɪtəs]:
1317 | 状态、地位
1318 | `},
1319 |
1320 | {
1321 | "text": "stack",
1322 | "desc": `
1323 | [stæk]:
1324 | 堆、栈
1325 | `},
1326 |
1327 | {
1328 | "text": "statement",
1329 | "desc": `
1330 | ['steɪtm(ə)nt]:
1331 | 声明、叙述
1332 | `},
1333 |
1334 | {
1335 | "text": "structure",
1336 | "desc": `
1337 | ['strʌktʃə]:
1338 | 结构、构造
1339 | `},
1340 |
1341 | {
1342 | "text": "studio",
1343 | "desc": `
1344 | ['stjuːdɪəʊ]:
1345 | 工作室
1346 | `},
1347 |
1348 | {
1349 | "text": "similar",
1350 | "desc": `
1351 | ['sɪmɪlə]:
1352 | 相似
1353 | `},
1354 |
1355 | {
1356 | "text": "subclass",
1357 | "desc": `
1358 | ['sʌbklɑːs]:
1359 | 子类、子集
1360 | `},
1361 |
1362 | {
1363 | "text": "subscribe",
1364 | "desc": `
1365 | [səb'skraɪb]:
1366 | 订阅
1367 | `},
1368 |
1369 | {
1370 | "text": "sticky",
1371 | "desc": `
1372 | [ˈstɪki]:
1373 | 粘的
1374 | `},
1375 |
1376 | {
1377 | "text": "shim",
1378 | "desc": `
1379 | [ʃɪm]:
1380 | 垫片、填隙片
1381 | `},
1382 |
1383 |
1384 | {
1385 | "text": "task",
1386 | "desc": `
1387 | [tɑːsk]:
1388 | 任务
1389 | `},
1390 |
1391 | {
1392 | "text": "traversal",
1393 | "desc": `
1394 | [trəˈvərs(ə)l]:
1395 | 遍历
1396 | `},
1397 |
1398 | {
1399 | "text": "temporary",
1400 | "desc": `
1401 | [ˈtemprəri]:
1402 | 临时
1403 | `},
1404 |
1405 | {
1406 | "text": "terminal",
1407 | "desc": `
1408 | ['tɜːmɪn(ə)l]:
1409 | 终端、终点
1410 | `},
1411 |
1412 | {
1413 | "text": "track",
1414 | "desc": `
1415 | [træk]:
1416 | 追踪
1417 | `},
1418 |
1419 | {
1420 | "text": "tutorial",
1421 | "desc": `
1422 | [tjuː'tɔːrɪəl]:
1423 | 教程
1424 | `},
1425 |
1426 |
1427 | {
1428 | "text": "upgrade",
1429 | "desc": `
1430 | [ʌp'greɪd]:
1431 | 升级
1432 | `},
1433 |
1434 | {
1435 | "text": "unique",
1436 | "desc": `
1437 | [juˈniːk]]:
1438 | 唯一的、独一无二的
1439 | `},
1440 |
1441 | {
1442 | "text": "vertical",
1443 | "desc": `
1444 | ['vɜːtɪk(ə)l]:
1445 | 垂直
1446 | `},
1447 |
1448 | {
1449 | "text": "vendors",
1450 | "desc": `
1451 | ['vendəz]:
1452 | 供应商
1453 | `},
1454 |
1455 | {
1456 | "text": "via",
1457 | "desc": `
1458 | [ˈvaɪə]:
1459 | 通过
1460 | `},
1461 |
1462 | {
1463 | "text": "void",
1464 | "desc": `
1465 | [vɒɪd]:
1466 | 空的
1467 | `},
1468 |
1469 | {
1470 | "text": "virtual",
1471 | "desc": `
1472 | [ˈvɜ:tʃuəl]:
1473 | 虚拟的
1474 | `},
1475 |
1476 |
1477 | {
1478 | "text": "widget",
1479 | "desc": `
1480 | ['wɪdʒɪt]:
1481 | 小部件
1482 | `},
1483 |
1484 | {
1485 | "text": "wildcard",
1486 | "desc": `
1487 | ['waɪldkɑrd]:
1488 | 通配符
1489 | `},
1490 |
1491 | {
1492 | "text": "wrap",
1493 | "desc": `
1494 | [ræp]:
1495 | 包、包装
1496 | `},
1497 | ]
1498 |
1499 |
1500 |
1501 |
1502 |
1503 |
--------------------------------------------------------------------------------
/src/data/js/wd.ts:
--------------------------------------------------------------------------------
1 | export default [
2 | {
3 | 'text': 'SyntaxError',
4 | 'desc': '解析代码时发生的语法错误'
5 | },
6 | {
7 | 'text': 'ReferenceError',
8 | 'desc': '引用一个不存在的变量时发生的错误'
9 | },
10 | {
11 | 'text': 'RangeError',
12 | 'desc': '一个值超出有效范围时发生的错误'
13 | },
14 | {
15 | 'text': 'TypeError',
16 | 'desc': '变量或参数不是预期类型时发生的错误'
17 | }
18 | ]
--------------------------------------------------------------------------------
/src/data/test.ts:
--------------------------------------------------------------------------------
1 | let test = [
2 | { 'text': 'My', 'desc': 'My' },
3 | { 'text': 'father', 'desc': 'father' },
4 | { 'text': 'was', 'desc': 'was' }, { 'text': 'a', 'desc': 'a' },
5 | { 'text': 'self-taught', 'desc': 'self-taught' }, { 'text': 'mandolin', 'desc': 'mandolin' },
6 | { 'text': 'player.', 'desc': 'player.' }, { 'text': 'He', 'desc': 'He' }, { 'text': 'was', 'desc': 'was' },
7 | { 'text': 'one', 'desc': 'one' }, { 'text': 'of', 'desc': 'of' }, { 'text': 'the', 'desc': 'the' }, { 'text': 'best', 'desc': 'best' },
8 | { 'text': 'string', 'desc': 'string' }, { 'text': 'instrument', 'desc': 'instrument' }, { 'text': 'players', 'desc': 'players' },
9 | { 'text': 'in', 'desc': 'in' }, { 'text': 'our', 'desc': 'our' }, { 'text': 'town.', 'desc': 'town.' },
10 | { 'text': 'He', 'desc': 'He' }, { 'text': 'could', 'desc': 'could' }, { 'text': 'not', 'desc': 'not' },
11 | { 'text': 'read', 'desc': 'read' }, { 'text': 'music,', 'desc': 'music,' }, { 'text': 'but', 'desc': 'but' },
12 | { 'text': 'if', 'desc': 'if' }, { 'text': 'he', 'desc': 'he' }, { 'text': 'heard', 'desc': 'heard' },
13 | { 'text': 'a', 'desc': 'a' }, { 'text': 'tune', 'desc': 'tune' }, { 'text': 'a', 'desc': 'a' },
14 | { 'text': 'few', 'desc': 'few' }, { 'text': 'times,', 'desc': 'times,' }, { 'text': 'he', 'desc': 'he' },
15 | { 'text': 'could', 'desc': 'could' }, { 'text': 'play', 'desc': 'play' }, { 'text': 'it.', 'desc': 'it.' },
16 | { 'text': 'When', 'desc': 'When' }, { 'text': 'he', 'desc': 'he' }, { 'text': 'was', 'desc': 'was' },
17 | { 'text': 'younger,', 'desc': 'younger,' }, { 'text': 'he', 'desc': 'he' }, { 'text': 'was', 'desc': 'was' },
18 | { 'text': 'a', 'desc': 'a' }, { 'text': 'member', 'desc': 'member' }, { 'text': 'of', 'desc': 'of' },
19 | { 'text': 'a', 'desc': 'a' }, { 'text': 'small', 'desc': 'small' }, { 'text': 'country', 'desc': 'country' },
20 | { 'text': 'music', 'desc': 'music' }, { 'text': 'band.', 'desc': 'band.' }, { 'text': 'They', 'desc': 'They' },
21 | { 'text': 'would', 'desc': 'would' }, { 'text': 'play', 'desc': 'play' }, { 'text': 'at', 'desc': 'at' },
22 | { 'text': 'local', 'desc': 'local' }, { 'text': 'dances', 'desc': 'dances' }, { 'text': 'and', 'desc': 'and' },
23 | { 'text': 'on', 'desc': 'on' }, { 'text': 'a', 'desc': 'a' }, { 'text': 'few', 'desc': 'few' },
24 | { 'text': 'occasions', 'desc': 'occasions' }, { 'text': 'would', 'desc': 'would' }, { 'text': 'play', 'desc': 'play' },
25 | { 'text': 'for', 'desc': 'for' }, { 'text': 'the', 'desc': 'the' }, { 'text': 'local', 'desc': 'local' },
26 | { 'text': 'radio', 'desc': 'radio' }, { 'text': 'station.', 'desc': 'station.' }, { 'text': 'He', 'desc': 'He' },
27 | { 'text': 'often', 'desc': 'often' }, { 'text': 'told', 'desc': 'told' }, { 'text': 'us', 'desc': 'us' }, { 'text': 'how', 'desc': 'how' },
28 | { 'text': 'he', 'desc': 'he' }, { 'text': 'had', 'desc': 'had' }, { 'text': 'auditioned', 'desc': 'auditioned' }, { 'text': 'and', 'desc': 'and' },
29 | { 'text': 'earned', 'desc': 'earned' }, { 'text': 'a', 'desc': 'a' }, { 'text': 'position', 'desc': 'position' }, { 'text': 'in', 'desc': 'in' },
30 | { 'text': 'a', 'desc': 'a' }, { 'text': 'band', 'desc': 'band' }, { 'text': 'that', 'desc': 'that' }, { 'text': 'featured', 'desc': 'featured' },
31 | { 'text': 'Patsy', 'desc': 'Patsy' }, { 'text': 'Cline', 'desc': 'Cline' }, { 'text': 'as', 'desc': 'as' }, { 'text': 'their', 'desc': 'their' },
32 | { 'text': 'lead', 'desc': 'lead' }, { 'text': 'singer.', 'desc': 'singer.' }, { 'text': 'He', 'desc': 'He' }, { 'text': 'told', 'desc': 'told' },
33 | { 'text': 'the', 'desc': 'the' }, { 'text': 'family', 'desc': 'family' }, { 'text': 'that', 'desc': 'that' }, { 'text': 'after', 'desc': 'after' },
34 | { 'text': 'he', 'desc': 'he' }, { 'text': 'was', 'desc': 'was' }, { 'text': 'hired', 'desc': 'hired' }, { 'text': 'he', 'desc': 'he' },
35 | { 'text': 'never', 'desc': 'never' }, { 'text': 'went', 'desc': 'went' }, { 'text': 'back.', 'desc': 'back.' }, { 'text': 'Dad', 'desc': 'Dad' },
36 | { 'text': 'was', 'desc': 'was' }, { 'text': 'a', 'desc': 'a' }, { 'text': 'very', 'desc': 'very' }, { 'text': 'religious', 'desc': 'religious' },
37 | { 'text': 'man.', 'desc': 'man.' }, { 'text': 'He', 'desc': 'He' }, { 'text': 'stated', 'desc': 'stated' }, { 'text': 'that', 'desc': 'that' },
38 | { 'text': 'there', 'desc': 'there' }, { 'text': 'was', 'desc': 'was' }, { 'text': 'a', 'desc': 'a' }, { 'text': 'lot', 'desc': 'lot' },
39 | { 'text': 'of', 'desc': 'of' }, { 'text': 'drinking', 'desc': 'drinking' }, { 'text': 'and', 'desc': 'and' },
40 | { 'text': 'cursing', 'desc': 'cursing' }, { 'text': 'the', 'desc': 'the' }, { 'text': 'day', 'desc': 'day' },
41 | { 'text': 'of', 'desc': 'of' }, { 'text': 'his', 'desc': 'his' }, { 'text': 'audition', 'desc': 'audition' },
42 | { 'text': 'and', 'desc': 'and' }, { 'text': 'he', 'desc': 'he' }, { 'text': 'did', 'desc': 'did' }, { 'text': 'not', 'desc': 'not' },
43 | { 'text': 'want', 'desc': 'want' }, { 'text': 'to', 'desc': 'to' }, { 'text': 'be', 'desc': 'be' }, { 'text': 'around', 'desc': 'around' },
44 | { 'text': 'that', 'desc': 'that' }, { 'text': 'type', 'desc': 'type' }, { 'text': 'of', 'desc': 'of' },
45 | { 'text': 'environment.', 'desc': 'environment.' }
46 | ]
47 |
48 | export default test;
--------------------------------------------------------------------------------
/src/index.tsx:
--------------------------------------------------------------------------------
1 | import * as ReactDOM from 'react-dom';
2 | import * as React from 'react';
3 | import App from './pages/App';
4 | import * as serviceWorker from './serviceWorker';
5 |
6 |
7 | console.log(WEB_ENV);
8 |
9 | ReactDOM.render(, document.getElementById('root'));
10 |
11 | serviceWorker.unregister();
12 |
13 | if (module.hot) {
14 | module.hot.accept();
15 | }
16 |
--------------------------------------------------------------------------------
/src/pages/App.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import './commont.css';
3 | import Index from '.'
4 |
5 | export default function App() {
6 | return (
7 |
8 |
9 |
10 | );
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/src/pages/commont.css:
--------------------------------------------------------------------------------
1 | * {
2 | margin: 0;
3 | padding: 0;
4 | font-weight: 100!important;
5 | font-family: "Lucida Console", "Monaco", "Courier New", "Courier", "monospace", "宋体"!important;
6 | }
7 | .container {
8 | width: 1000px;
9 | margin: 0 auto;
10 | }
11 | .select {
12 | display: inline-block;
13 | width: 100px;
14 | height: 30px;
15 | }
16 | .button {
17 | display: inline-block;
18 | width: 100px;
19 | height: 30px;
20 | vertical-align: middle;
21 | }
22 | .ml-sm {
23 | margin-left: 10px;
24 | }
--------------------------------------------------------------------------------
/src/pages/index.less:
--------------------------------------------------------------------------------
1 | .result {
2 | height: 30px;
3 | margin-top: 20px;
4 | }
--------------------------------------------------------------------------------
/src/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { useState, useRef, useEffect } from 'react';
2 | import Coder, { CoderMethots } from '../Components/Coder';
3 | // import produce from 'immer'
4 | import {
5 | jsWebGLData,
6 | jsAllData,
7 | jsStringData,
8 | jsArrayData,
9 | jsDateData,
10 | jsMathData,
11 | jsNumberData,
12 | jsObjectData,
13 | jsMapSetData,
14 | jsPromiseData,
15 | jsGlobalData,
16 | jsWordsData
17 | } from '../data'
18 | import styles from './index.less'
19 |
20 | export default function Index() {
21 |
22 | const [select, setSelect] = useState('11')
23 | const [speed, setSpeed] = useState('')
24 | const [correct, setCorrect] = useState('')
25 | const [codeData, setCodeData] = useState(jsWebGLData)
26 | const [coderKey, updateCoderKey] = useState('')
27 | const [isStart, setIsStart] = useState(false)
28 | const codeRef = useRef(null)
29 |
30 |
31 | useEffect(() => {
32 | if(coderKey && isStart) {
33 | const coder = codeRef.current
34 | if(coder) {
35 | coder.start()
36 | }
37 | }
38 | }, [coderKey, isStart])
39 |
40 | function changeSelect(e: React.ChangeEvent) {
41 | const value = e.target.value
42 | updateCoderKey(Math.random() + '' + new Date().getTime())
43 | setIsStart(false)
44 | setSelect(value)
45 | switch (value) {
46 | case '0':
47 | setCodeData(jsAllData)
48 | break;
49 | case '1':
50 | setCodeData(jsArrayData)
51 | break;
52 | case '2':
53 | setCodeData(jsDateData)
54 | break;
55 | case '3':
56 | setCodeData(jsMathData)
57 | break;
58 | case '4':
59 | setCodeData(jsNumberData)
60 | break;
61 | case '5':
62 | setCodeData(jsObjectData)
63 | break;
64 | case '6':
65 | setCodeData(jsStringData)
66 | break;
67 | case '7':
68 | setCodeData(jsMapSetData)
69 | break;
70 | case '8':
71 | setCodeData(jsPromiseData)
72 | break;
73 | case '9':
74 | setCodeData(jsGlobalData)
75 | break;
76 | case '10':
77 | setCodeData(jsWordsData)
78 | break;
79 | case '11':
80 | setCodeData(jsWebGLData)
81 | break;
82 | default :
83 | setCodeData(jsArrayData)
84 | }
85 | }
86 |
87 | function start() {
88 | updateCoderKey(Math.random() + '' + new Date().getTime())
89 | setIsStart(true)
90 | }
91 | function restart() {
92 | updateCoderKey(Math.random() + '' + new Date().getTime())
93 | setIsStart(true)
94 | }
95 |
96 | function end(speed: string, correct: string) {
97 | setSpeed(speed)
98 | setCorrect(correct)
99 | }
100 | return (<>
101 |
102 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 | {speed && correct &&
速度:{speed} 正确率:{correct}
}
124 |
125 |
126 |
127 | >)
128 | }
--------------------------------------------------------------------------------
/src/react-app-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 | ///
4 |
5 | declare namespace NodeJS {
6 | interface ProcessEnv {
7 | readonly NODE_ENV: 'development' | 'production' | 'test';
8 | readonly PUBLIC_URL: string;
9 | }
10 | }
11 |
12 | declare module '*.bmp' {
13 | const src: string;
14 | export default src;
15 | }
16 |
17 | declare module '*.gif' {
18 | const src: string;
19 | export default src;
20 | }
21 |
22 | declare module '*.jpg' {
23 | const src: string;
24 | export default src;
25 | }
26 |
27 | declare module '*.jpeg' {
28 | const src: string;
29 | export default src;
30 | }
31 |
32 | declare module '*.png' {
33 | const src: string;
34 | export default src;
35 | }
36 |
37 | declare module '*.webp' {
38 | const src: string;
39 | export default src;
40 | }
41 |
42 | declare module '*.svg' {
43 | import * as React from 'react';
44 |
45 | export const ReactComponent: React.FunctionComponent>;
46 |
47 | const src: string;
48 | export default src;
49 | }
50 |
51 | declare module '*.module.css' {
52 | const classes: { readonly [key: string]: string };
53 | export default classes;
54 | }
55 |
56 | declare module '*.module.scss' {
57 | const classes: { readonly [key: string]: string };
58 | export default classes;
59 | }
60 |
61 | declare module '*.module.sass' {
62 | const classes: { readonly [key: string]: string };
63 | export default classes;
64 | }
65 |
66 | declare module '*.less'
67 |
68 | declare const WEB_ENV : string
69 |
--------------------------------------------------------------------------------
/src/serviceWorker.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | // This optional code is used to register a service worker.
3 | // register() is not called by default.
4 |
5 | // This lets the app load faster on subsequent visits in production, and gives
6 | // it offline capabilities. However, it also means that developers (and users)
7 | // will only see deployed updates on subsequent visits to a page, after all the
8 | // existing tabs open on the page have been closed, since previously cached
9 | // resources are updated in the background.
10 |
11 | // To learn more about the benefits of this model and instructions on how to
12 | // opt-in, read https://bit.ly/CRA-PWA
13 |
14 | const isLocalhost = Boolean(
15 | window.location.hostname === 'localhost' ||
16 | // [::1] is the IPv6 localhost address.
17 | window.location.hostname === '[::1]' ||
18 | // 127.0.0.0/8 are considered localhost for IPv4.
19 | window.location.hostname.match(
20 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
21 | )
22 | );
23 |
24 | type Config = {
25 | onSuccess?: (registration: ServiceWorkerRegistration) => void;
26 | onUpdate?: (registration: ServiceWorkerRegistration) => void;
27 | };
28 |
29 | export function register(config?: Config) {
30 | if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
31 | // The URL constructor is available in all browsers that support SW.
32 | const publicUrl = new URL(
33 | process.env.PUBLIC_URL,
34 | window.location.href
35 | );
36 | if (publicUrl.origin !== window.location.origin) {
37 | // Our service worker won't work if PUBLIC_URL is on a different origin
38 | // from what our page is served on. This might happen if a CDN is used to
39 | // serve assets; see https://github.com/facebook/create-react-app/issues/2374
40 | return;
41 | }
42 |
43 | window.addEventListener('load', () => {
44 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
45 |
46 | if (isLocalhost) {
47 | // This is running on localhost. Let's check if a service worker still exists or not.
48 | checkValidServiceWorker(swUrl, config);
49 |
50 | // Add some additional logging to localhost, pointing developers to the
51 | // service worker/PWA documentation.
52 | navigator.serviceWorker.ready.then(() => {
53 | console.log(
54 | 'This web app is being served cache-first by a service ' +
55 | 'worker. To learn more, visit https://bit.ly/CRA-PWA'
56 | );
57 | });
58 | } else {
59 | // Is not localhost. Just register service worker
60 | registerValidSW(swUrl, config);
61 | }
62 | });
63 | }
64 | }
65 |
66 | function registerValidSW(swUrl: string, config?: Config) {
67 | navigator.serviceWorker
68 | .register(swUrl)
69 | .then(registration => {
70 | registration.onupdatefound = () => {
71 | const installingWorker = registration.installing;
72 | if (installingWorker == null) {
73 | return;
74 | }
75 | installingWorker.onstatechange = () => {
76 | if (installingWorker.state === 'installed') {
77 | if (navigator.serviceWorker.controller) {
78 | // At this point, the updated precached content has been fetched,
79 | // but the previous service worker will still serve the older
80 | // content until all client tabs are closed.
81 | console.log(
82 | 'New content is available and will be used when all ' +
83 | 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
84 | );
85 |
86 | // Execute callback
87 | if (config && config.onUpdate) {
88 | config.onUpdate(registration);
89 | }
90 | } else {
91 | // At this point, everything has been precached.
92 | // It's the perfect time to display a
93 | // "Content is cached for offline use." message.
94 | console.log('Content is cached for offline use.');
95 |
96 | // Execute callback
97 | if (config && config.onSuccess) {
98 | config.onSuccess(registration);
99 | }
100 | }
101 | }
102 | };
103 | };
104 | })
105 | .catch(error => {
106 | console.error('Error during service worker registration:', error);
107 | });
108 | }
109 |
110 | function checkValidServiceWorker(swUrl: string, config?: Config) {
111 | // Check if the service worker can be found. If it can't reload the page.
112 | fetch(swUrl, {
113 | headers: { 'Service-Worker': 'script' }
114 | })
115 | .then(response => {
116 | // Ensure service worker exists, and that we really are getting a JS file.
117 | const contentType = response.headers.get('content-type');
118 | if (
119 | response.status === 404 ||
120 | (contentType != null && contentType.indexOf('javascript') === -1)
121 | ) {
122 | // No service worker found. Probably a different app. Reload the page.
123 | navigator.serviceWorker.ready.then(registration => {
124 | registration.unregister().then(() => {
125 | window.location.reload();
126 | });
127 | });
128 | } else {
129 | // Service worker found. Proceed as normal.
130 | registerValidSW(swUrl, config);
131 | }
132 | })
133 | .catch(() => {
134 | console.log(
135 | 'No internet connection found. App is running in offline mode.'
136 | );
137 | });
138 | }
139 |
140 | export function unregister() {
141 | if ('serviceWorker' in navigator) {
142 | navigator.serviceWorker.ready.then(registration => {
143 | registration.unregister();
144 | });
145 | }
146 | }
147 | /* eslint-disable */
--------------------------------------------------------------------------------
/src/setupTests.ts:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom/extend-expect';
6 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./src/.umi/tsconfig.json"
3 | }
4 |
--------------------------------------------------------------------------------
/typings.d.ts:
--------------------------------------------------------------------------------
1 | import 'umi/typings';
2 |
--------------------------------------------------------------------------------