本周了解了如下知识点: TypeScript Basic
、 ios-deploy
、Dockerfile 和 apt-get update 加速
一、TypeScript 基础类型使用
任意属性 [otherProps: string]: number | string | undefined;
interface Person {
readonly id: number;
name: string;
age?: number;
[otherProps: string]: number | string | undefined; // 任意属性的用法
}
const tom: Person = {
id: 424532,
name: 'Tom',
age: undefined,
education: 'university', // 因为使用了任意属性,所以在这里新增属性没问题
gender: 'male', // 因为使用了任意属性,所以在这里新增属性没问题
};
声明(下列的声明主要用于第三方库,写 xxx.d.ts 文件)
-
declare var
声明全局变量 -
declare function
声明全局方法 -
declare class
声明全局类 -
declare enum
声明全局枚举类型 -
declare namespace
声明全局命名空间 -
interface
或type
声明全局类型 -
declare global
扩展全局变量 -
declare module
扩展模块
二、解决 ios-deploy 无法安装在最新的 macOS Catalina 系统
部分报错信息:
"ld: framework not found MobileDevice" on macOS Catalina
解决办法:
-
npm uninstall -g ios-deploy
-
yarn global remove ios-deploy
(if you installed it with yarn global) -
npm i -g ios-deploy@beta
三、apt-get update 加速
Dockerfile
FROM ubuntu:14.04
MAINTAINER kenny kenny@mail.com
RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y nginx
#COPY index.html /var/www/html
#ENTRYPOINT ["/usr/sbin/nginx", "-g", "daemon off;"]
EXPOSE 8083
网友评论