当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript utils.log函数代码示例

本文整理汇总了TypeScript中@library/utility/utils.log函数的典型用法代码示例。如果您正苦于以下问题:TypeScript log函数的具体用法?TypeScript log怎么用?TypeScript log使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了log函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: log

export const allButtonStates = (styles: IButtonStates, nested?: object, debugMode?: boolean) => {
    const allStates = styles.allStates !== undefined ? styles.allStates : {};
    const noState = styles.noState !== undefined ? styles.noState : {};

    const output = {
        ...allStates,
        ...noState,
        $nest: {
            "&:hover": { ...allStates, ...styles.hover },
            "&:focus": { ...allStates, ...styles.focus },
            "&:focus:not(.focus-visible)": { ...allStates, ...styles.focusNotKeyboard },
            "&&.focus-visible": { ...allStates, ...styles.accessibleFocus },
            "&:active": { ...allStates, ...styles.active },
            ...nested,
        },
    };

    if (debugMode) {
        log("allButtonStates: ");
        log("style: ", styles);
        log("nested: ", nested);
        log("output: ", output);
    }

    return output;
};
开发者ID:vanilla,项目名称:vanilla,代码行数:26,代码来源:styleHelpers.ts

示例2: styleCreator

    function styleCreator(...objects: Array<NestedCSSProperties | string | symbol>): string {
        if (objects.length === 0) {
            return style();
        }

        let debugName = componentName;
        let shouldLogDebug = false;
        let styleObjs: Array<NestedCSSProperties | undefined> = objects as any;
        if (objects[0] === DEBUG_STYLES) {
            styleObjs.shift();
            shouldLogDebug = true;
        }
        if (typeof objects[0] === "string") {
            const [subcomponentName, ...restObjects] = styleObjs;
            debugName += `-${subcomponentName}`;
            styleObjs = restObjects;
        }

        if (shouldLogDebug) {
            logWarning(`Debugging component ${debugName}`);
            log(styleObjs);
        }

        return style({ $debugName: debugName }, ...styleObjs);
    }
开发者ID:vanilla,项目名称:vanilla,代码行数:25,代码来源:styleUtils.ts

示例3: log

    .then(() => {
        log("Bootstrapping complete.");
        // Mount all data-react components.
        onContent(e => {
            _mountComponents(e.target);
        });

        const contentEvent = new CustomEvent("X-DOMContentReady", { bubbles: true, cancelable: false });
        document.dispatchEvent(contentEvent);
    })
开发者ID:vanilla,项目名称:vanilla,代码行数:10,代码来源:bootstrap.ts

示例4: log

tplEval: (tpl, map) => log(map),
开发者ID:vanilla,项目名称:vanilla,代码行数:1,代码来源:atwho.ts

示例5: getMeta

 * @license GPL-2.0-only
 */

import { onContent, getMeta, _executeReady, _mountComponents } from "@library/utility/appUtils";
import { log, logError, debug } from "@library/utility/utils";
import gdn from "@library/gdn";
import apiv2 from "@library/apiv2";

// Inject the debug flag into the utility.
const debugValue = getMeta("context.debug", getMeta("debug", false));
debug(debugValue);

// Export the API to the global object.
gdn.apiv2 = apiv2;

log("Bootstrapping");
_executeReady()
    .then(() => {
        log("Bootstrapping complete.");
        // Mount all data-react components.
        onContent(e => {
            _mountComponents(e.target);
        });

        const contentEvent = new CustomEvent("X-DOMContentReady", { bubbles: true, cancelable: false });
        document.dispatchEvent(contentEvent);
    })
    .catch(error => {
        logError(error);
    });
开发者ID:vanilla,项目名称:vanilla,代码行数:30,代码来源:bootstrap.ts


注:本文中的@library/utility/utils.log函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。