美文网首页
Weekly 2019-43

Weekly 2019-43

作者: Kenny锅 | 来源:发表于2019-10-27 20:38 被阅读0次

    本周了解了如下知识点: TypeScript Basicios-deployDockerfile 和 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 声明全局命名空间
    • interfacetype 声明全局类型
    • declare global 扩展全局变量
    • declare module 扩展模块

    二、解决 ios-deploy 无法安装在最新的 macOS Catalina 系统

    部分报错信息:
    "ld: framework not found MobileDevice" on macOS Catalina
    

    解决办法:

    1. npm uninstall -g ios-deploy

    2. yarn global remove ios-deploy (if you installed it with yarn global)

    3. 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
    

    相关文章

      网友评论

          本文标题:Weekly 2019-43

          本文链接:https://www.haomeiwen.com/subject/ijzzmctx.html