mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-21 03:05:38 -05:00
Add more type definitions (#882)
* More typing to base.ts * Add more types * More types
This commit is contained in:
@@ -56,8 +56,8 @@ export const defaultConfig: AppConfig = {
|
||||
|
||||
|
||||
export function loadConfigFromElement(el: Element): AppConfig {
|
||||
let srcConfig;
|
||||
let inlineConfig;
|
||||
let srcConfig: AppConfig;
|
||||
let inlineConfig: AppConfig;
|
||||
if (el === null) {
|
||||
srcConfig = {};
|
||||
inlineConfig = {};
|
||||
@@ -127,7 +127,7 @@ function mergeConfig(inlineConfig: AppConfig, externalConfig: AppConfig): AppCon
|
||||
|
||||
for (const keyType in allKeys)
|
||||
{
|
||||
const keys = allKeys[keyType];
|
||||
const keys: string[] = allKeys[keyType];
|
||||
keys.forEach(function(item: string){
|
||||
if (keyType === "boolean")
|
||||
{
|
||||
@@ -199,14 +199,14 @@ function validateConfig(configText: string, configType = "toml") {
|
||||
|
||||
for (const keyType in allKeys)
|
||||
{
|
||||
const keys = allKeys[keyType];
|
||||
const keys: string[] = allKeys[keyType];
|
||||
keys.forEach(function(item: string){
|
||||
if (validateParamInConfig(item, keyType, config))
|
||||
{
|
||||
if (item === "runtimes")
|
||||
{
|
||||
finalConfig[item] = [];
|
||||
const runtimes = config[item];
|
||||
const runtimes = config[item] as object[];
|
||||
runtimes.forEach(function(eachRuntime: object){
|
||||
const runtimeConfig: object = {};
|
||||
for (const eachRuntimeParam in eachRuntime)
|
||||
|
||||
Reference in New Issue
Block a user