@yakuzaa/jade-runtime 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apis/audit_service.d.ts +43 -0
- package/dist/apis/audit_service.d.ts.map +1 -0
- package/dist/apis/audit_service.js +73 -0
- package/dist/apis/audit_service.js.map +1 -0
- package/dist/apis/auth_service.d.ts +51 -0
- package/dist/apis/auth_service.d.ts.map +1 -0
- package/dist/apis/auth_service.js +120 -0
- package/dist/apis/auth_service.js.map +1 -0
- package/dist/apis/console_api.d.ts +34 -0
- package/dist/apis/console_api.d.ts.map +1 -0
- package/dist/apis/console_api.js +90 -0
- package/dist/apis/console_api.js.map +1 -0
- package/dist/apis/datetime_api.d.ts +13 -0
- package/dist/apis/datetime_api.d.ts.map +1 -0
- package/dist/apis/datetime_api.js +89 -0
- package/dist/apis/datetime_api.js.map +1 -0
- package/dist/apis/http_client.d.ts +32 -0
- package/dist/apis/http_client.d.ts.map +1 -0
- package/dist/apis/http_client.js +83 -0
- package/dist/apis/http_client.js.map +1 -0
- package/dist/apis/permission_service.d.ts +18 -0
- package/dist/apis/permission_service.d.ts.map +1 -0
- package/dist/apis/permission_service.js +56 -0
- package/dist/apis/permission_service.js.map +1 -0
- package/dist/core/event_loop.d.ts +14 -0
- package/dist/core/event_loop.d.ts.map +1 -0
- package/dist/core/event_loop.js +60 -0
- package/dist/core/event_loop.js.map +1 -0
- package/dist/core/memory_manager.d.ts +43 -0
- package/dist/core/memory_manager.d.ts.map +1 -0
- package/dist/core/memory_manager.js +218 -0
- package/dist/core/memory_manager.js.map +1 -0
- package/dist/core/runtime.d.ts +18 -0
- package/dist/core/runtime.d.ts.map +1 -0
- package/dist/core/runtime.js +116 -0
- package/dist/core/runtime.js.map +1 -0
- package/dist/persistence/local_datastore.d.ts +34 -0
- package/dist/persistence/local_datastore.d.ts.map +1 -0
- package/dist/persistence/local_datastore.js +112 -0
- package/dist/persistence/local_datastore.js.map +1 -0
- package/dist/persistence/sync_manager.d.ts +49 -0
- package/dist/persistence/sync_manager.d.ts.map +1 -0
- package/dist/persistence/sync_manager.js +187 -0
- package/dist/persistence/sync_manager.js.map +1 -0
- package/dist/pwa/pwa_generator.d.ts +16 -0
- package/dist/pwa/pwa_generator.d.ts.map +1 -0
- package/dist/pwa/pwa_generator.js +107 -0
- package/dist/pwa/pwa_generator.js.map +1 -0
- package/dist/stdlib/matematica.d.ts +121 -0
- package/dist/stdlib/matematica.d.ts.map +1 -0
- package/dist/stdlib/matematica.js +250 -0
- package/dist/stdlib/matematica.js.map +1 -0
- package/dist/stdlib/moeda.d.ts +129 -0
- package/dist/stdlib/moeda.d.ts.map +1 -0
- package/dist/stdlib/moeda.js +212 -0
- package/dist/stdlib/moeda.js.map +1 -0
- package/dist/stdlib/texto.d.ts +101 -0
- package/dist/stdlib/texto.d.ts.map +1 -0
- package/dist/stdlib/texto.js +205 -0
- package/dist/stdlib/texto.js.map +1 -0
- package/dist/stdlib/xml.d.ts +77 -0
- package/dist/stdlib/xml.d.ts.map +1 -0
- package/dist/stdlib/xml.js +212 -0
- package/dist/stdlib/xml.js.map +1 -0
- package/dist/ui/binding.d.ts +22 -0
- package/dist/ui/binding.d.ts.map +1 -0
- package/dist/ui/binding.js +62 -0
- package/dist/ui/binding.js.map +1 -0
- package/dist/ui/components/botao.d.ts +4 -0
- package/dist/ui/components/botao.d.ts.map +1 -0
- package/dist/ui/components/botao.js +4 -0
- package/dist/ui/components/botao.js.map +1 -0
- package/dist/ui/components/campo.d.ts +8 -0
- package/dist/ui/components/campo.d.ts.map +1 -0
- package/dist/ui/components/campo.js +9 -0
- package/dist/ui/components/campo.js.map +1 -0
- package/dist/ui/components/card.d.ts +4 -0
- package/dist/ui/components/card.d.ts.map +1 -0
- package/dist/ui/components/card.js +4 -0
- package/dist/ui/components/card.js.map +1 -0
- package/dist/ui/components/formulario.d.ts +4 -0
- package/dist/ui/components/formulario.d.ts.map +1 -0
- package/dist/ui/components/formulario.js +4 -0
- package/dist/ui/components/formulario.js.map +1 -0
- package/dist/ui/components/tabela.d.ts +3 -0
- package/dist/ui/components/tabela.d.ts.map +1 -0
- package/dist/ui/components/tabela.js +4 -0
- package/dist/ui/components/tabela.js.map +1 -0
- package/dist/ui/reactive.d.ts +61 -0
- package/dist/ui/reactive.d.ts.map +1 -0
- package/dist/ui/reactive.js +149 -0
- package/dist/ui/reactive.js.map +1 -0
- package/dist/ui/refs.d.ts +13 -0
- package/dist/ui/refs.d.ts.map +1 -0
- package/dist/ui/refs.js +32 -0
- package/dist/ui/refs.js.map +1 -0
- package/dist/ui/router.d.ts +39 -0
- package/dist/ui/router.d.ts.map +1 -0
- package/dist/ui/router.js +74 -0
- package/dist/ui/router.js.map +1 -0
- package/dist/ui/theme.d.ts +19 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +183 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/ui/ui_engine.d.ts +89 -0
- package/dist/ui/ui_engine.d.ts.map +1 -0
- package/dist/ui/ui_engine.js +406 -0
- package/dist/ui/ui_engine.js.map +1 -0
- package/dist/ui/virtual_list.d.ts +29 -0
- package/dist/ui/virtual_list.d.ts.map +1 -0
- package/dist/ui/virtual_list.js +88 -0
- package/dist/ui/virtual_list.js.map +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export class PWAGenerator {
|
|
2
|
+
gerarManifest(config) {
|
|
3
|
+
return JSON.stringify({
|
|
4
|
+
name: config.nome,
|
|
5
|
+
short_name: config.nomeAbreviado ?? config.nome.slice(0, 12),
|
|
6
|
+
description: config.descricao ?? '',
|
|
7
|
+
display: 'standalone',
|
|
8
|
+
start_url: '/',
|
|
9
|
+
scope: '/',
|
|
10
|
+
theme_color: config.cor_tema ?? '#2563eb',
|
|
11
|
+
background_color: config.cor_fundo ?? '#ffffff',
|
|
12
|
+
icons: [
|
|
13
|
+
{
|
|
14
|
+
src: config.icone ?? '/icon-192.png',
|
|
15
|
+
sizes: '192x192',
|
|
16
|
+
type: 'image/png'
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
src: config.icone ?? '/icon-512.png',
|
|
20
|
+
sizes: '512x512',
|
|
21
|
+
type: 'image/png'
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}, null, 2);
|
|
25
|
+
}
|
|
26
|
+
gerarServiceWorker(config) {
|
|
27
|
+
const cacheName = `jade-${config.nome.toLowerCase().replace(/\s+/g, '-')}-v1`;
|
|
28
|
+
const arquivos = config.arquivosCache ?? ['/', '/index.html', '/app.wasm', '/manifest.json'];
|
|
29
|
+
return `const CACHE_NAME = '${cacheName}';
|
|
30
|
+
const ARQUIVOS_CACHE = ${JSON.stringify(arquivos)};
|
|
31
|
+
|
|
32
|
+
self.addEventListener('install', e => {
|
|
33
|
+
e.waitUntil(caches.open(CACHE_NAME).then(c => c.addAll(ARQUIVOS_CACHE)));
|
|
34
|
+
self.skipWaiting();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
self.addEventListener('activate', e => {
|
|
38
|
+
e.waitUntil(
|
|
39
|
+
caches.keys().then(keys =>
|
|
40
|
+
Promise.all(
|
|
41
|
+
keys.filter(k => k.startsWith('jade-') && k !== CACHE_NAME)
|
|
42
|
+
.map(k => caches.delete(k))
|
|
43
|
+
)
|
|
44
|
+
)
|
|
45
|
+
);
|
|
46
|
+
self.clients.claim();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
self.addEventListener('fetch', e => {
|
|
50
|
+
if (e.request.method !== 'GET') return;
|
|
51
|
+
e.respondWith(
|
|
52
|
+
caches.match(e.request).then(cached => {
|
|
53
|
+
if (cached) return cached;
|
|
54
|
+
return fetch(e.request).then(res => {
|
|
55
|
+
if (!res || res.status !== 200 || res.type !== 'basic') return res;
|
|
56
|
+
const clone = res.clone();
|
|
57
|
+
caches.open(CACHE_NAME).then(c => c.put(e.request, clone));
|
|
58
|
+
return res;
|
|
59
|
+
}).catch(() =>
|
|
60
|
+
caches.match('/offline.html') ??
|
|
61
|
+
new Response('<h1>Sem conexão</h1>', { headers: { 'Content-Type': 'text/html' } })
|
|
62
|
+
);
|
|
63
|
+
})
|
|
64
|
+
);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Background sync: notifica o app quando conexão retorna
|
|
68
|
+
self.addEventListener('sync', e => {
|
|
69
|
+
if (e.tag === 'jade-sync') {
|
|
70
|
+
e.waitUntil(
|
|
71
|
+
self.clients.matchAll().then(clients =>
|
|
72
|
+
clients.forEach(c => c.postMessage({ tipo: 'sync-requisitado' }))
|
|
73
|
+
)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
});`;
|
|
77
|
+
}
|
|
78
|
+
gerarIndexHTML(config) {
|
|
79
|
+
return `<!DOCTYPE html>
|
|
80
|
+
<html lang="pt-BR">
|
|
81
|
+
<head>
|
|
82
|
+
<meta charset="UTF-8">
|
|
83
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
84
|
+
<title>${config.nome}</title>
|
|
85
|
+
<link rel="manifest" href="/manifest.json">
|
|
86
|
+
<meta name="theme-color" content="${config.cor_tema ?? '#2563eb'}">
|
|
87
|
+
<meta name="description" content="${config.descricao ?? ''}">
|
|
88
|
+
</head>
|
|
89
|
+
<body>
|
|
90
|
+
<div id="app"></div>
|
|
91
|
+
<script type="module">
|
|
92
|
+
if ('serviceWorker' in navigator) {
|
|
93
|
+
navigator.serviceWorker.register('/service_worker.js')
|
|
94
|
+
.then(() => console.log('[JADE] Service Worker registrado'))
|
|
95
|
+
.catch(e => console.warn('[JADE] SW falhou:', e));
|
|
96
|
+
}
|
|
97
|
+
navigator.serviceWorker?.addEventListener('message', e => {
|
|
98
|
+
if (e.data?.tipo === 'sync-requisitado') {
|
|
99
|
+
window.dispatchEvent(new CustomEvent('jade:sync'));
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
</script>
|
|
103
|
+
</body>
|
|
104
|
+
</html>`;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=pwa_generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pwa_generator.js","sourceRoot":"","sources":["../../pwa/pwa_generator.ts"],"names":[],"mappings":"AAWA,MAAM,OAAO,YAAY;IACvB,aAAa,CAAC,MAAiB;QAC7B,OAAO,IAAI,CAAC,SAAS,CAAC;YACpB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,UAAU,EAAE,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;YAC5D,WAAW,EAAE,MAAM,CAAC,SAAS,IAAI,EAAE;YACnC,OAAO,EAAE,YAAY;YACrB,SAAS,EAAE,GAAG;YACd,KAAK,EAAE,GAAG;YACV,WAAW,EAAE,MAAM,CAAC,QAAQ,IAAI,SAAS;YACzC,gBAAgB,EAAE,MAAM,CAAC,SAAS,IAAI,SAAS;YAC/C,KAAK,EAAE;gBACL;oBACE,GAAG,EAAE,MAAM,CAAC,KAAK,IAAI,eAAe;oBACpC,KAAK,EAAE,SAAS;oBAChB,IAAI,EAAE,WAAW;iBAClB;gBACD;oBACE,GAAG,EAAE,MAAM,CAAC,KAAK,IAAI,eAAe;oBACpC,KAAK,EAAE,SAAS;oBAChB,IAAI,EAAE,WAAW;iBAClB;aACF;SACF,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACd,CAAC;IAED,kBAAkB,CAAC,MAAiB;QAClC,MAAM,SAAS,GAAG,QAAQ,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC;QAC9E,MAAM,QAAQ,GAAG,MAAM,CAAC,aAAa,IAAI,CAAC,GAAG,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC;QAE7F,OAAO,uBAAuB,SAAS;yBAClB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8C7C,CAAC;IACH,CAAC;IAED,cAAc,CAAC,MAAiB;QAC9B,OAAO;;;;;WAKA,MAAM,CAAC,IAAI;;sCAEgB,MAAM,CAAC,QAAQ,IAAI,SAAS;sCAC5B,MAAM,CAAC,SAAS,IAAI,EAAE;;;;;;;;;;;;;;;;;QAiBpD,CAAC;IACP,CAAC;CACF"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Biblioteca matemática e estatística para o runtime JADE
|
|
3
|
+
* Acessível via Matematica.metodo(args) no código JADE
|
|
4
|
+
*/
|
|
5
|
+
export declare class MatematicaStdlib {
|
|
6
|
+
static soma(lista: number[]): number;
|
|
7
|
+
static media(lista: number[]): number;
|
|
8
|
+
static mediana(lista: number[]): number;
|
|
9
|
+
static desvioPadrao(lista: number[]): number;
|
|
10
|
+
static variancia(lista: number[]): number;
|
|
11
|
+
static minimo(lista: number[]): number;
|
|
12
|
+
static maximo(lista: number[]): number;
|
|
13
|
+
static arredondar(valor: number, casas?: number): number;
|
|
14
|
+
static abs(valor: number): number;
|
|
15
|
+
static potencia(base: number, expoente: number): number;
|
|
16
|
+
static raiz(valor: number): number;
|
|
17
|
+
/**
|
|
18
|
+
* Curva ABC (classificação de Pareto)
|
|
19
|
+
* Retorna cada item com sua classe (A, B ou C) baseado em percentual acumulado
|
|
20
|
+
* Classe A: 0–80%, Classe B: 80–95%, Classe C: 95–100%
|
|
21
|
+
*/
|
|
22
|
+
static curvaABC(itens: {
|
|
23
|
+
id: string;
|
|
24
|
+
valor: number;
|
|
25
|
+
}[]): {
|
|
26
|
+
id: string;
|
|
27
|
+
valor: number;
|
|
28
|
+
percentual: number;
|
|
29
|
+
acumulado: number;
|
|
30
|
+
classe: 'A' | 'B' | 'C';
|
|
31
|
+
}[];
|
|
32
|
+
/**
|
|
33
|
+
* Percentil — retorna o valor no percentil p (0–100) da lista
|
|
34
|
+
*/
|
|
35
|
+
static percentil(lista: number[], p: number): number;
|
|
36
|
+
/**
|
|
37
|
+
* Correlação de Pearson entre dois conjuntos de dados
|
|
38
|
+
*/
|
|
39
|
+
static correlacao(x: number[], y: number[]): number;
|
|
40
|
+
/**
|
|
41
|
+
* Média móvel simples (SMA) — O(n) com janela deslizante
|
|
42
|
+
*/
|
|
43
|
+
static mediaMóvel(lista: number[], janela: number): number[];
|
|
44
|
+
/**
|
|
45
|
+
* Taxa de crescimento percentual entre dois valores
|
|
46
|
+
*/
|
|
47
|
+
static taxaCrescimento(valorInicial: number, valorFinal: number): number;
|
|
48
|
+
/**
|
|
49
|
+
* Regressão linear simples — ajusta a reta y = a·x + b aos dados
|
|
50
|
+
* @returns { a, b, r2 }
|
|
51
|
+
* a = inclinação (tendência por período)
|
|
52
|
+
* b = intercepto (valor inicial projetado)
|
|
53
|
+
* r2 = coeficiente de determinação 0–1 (1 = ajuste perfeito)
|
|
54
|
+
*
|
|
55
|
+
* Uso típico: prever demanda futura a partir do histórico de vendas
|
|
56
|
+
* const { a, b } = Matematica.regressaoLinear(vendas)
|
|
57
|
+
* previsao = a * proximoPeriodo + b
|
|
58
|
+
*/
|
|
59
|
+
static regressaoLinear(y: number[]): {
|
|
60
|
+
a: number;
|
|
61
|
+
b: number;
|
|
62
|
+
r2: number;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Detecta outliers usando o método IQR (Intervalo Interquartil)
|
|
66
|
+
* Outlier: valor abaixo de Q1 − 1.5×IQR ou acima de Q3 + 1.5×IQR
|
|
67
|
+
* @returns { normais, outliers, q1, q3, iqr, limiteInferior, limiteSuperior }
|
|
68
|
+
*
|
|
69
|
+
* Uso típico: filtrar picos atípicos de venda antes de projetar estoque
|
|
70
|
+
*/
|
|
71
|
+
static detectarOutliers(lista: number[]): {
|
|
72
|
+
normais: number[];
|
|
73
|
+
outliers: number[];
|
|
74
|
+
q1: number;
|
|
75
|
+
q3: number;
|
|
76
|
+
iqr: number;
|
|
77
|
+
limiteInferior: number;
|
|
78
|
+
limiteSuperior: number;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Juros compostos — retorna o montante final
|
|
82
|
+
* @param principal Valor inicial (ex: 10000)
|
|
83
|
+
* @param taxa Taxa por período como decimal (ex: 0.12 = 12% a.a.)
|
|
84
|
+
* @param tempo Número de períodos (ex: 5 anos)
|
|
85
|
+
* @returns Montante: principal × (1 + taxa)^tempo
|
|
86
|
+
*/
|
|
87
|
+
static jurosCompostos(principal: number, taxa: number, tempo: number): number;
|
|
88
|
+
/**
|
|
89
|
+
* Valor Presente Líquido (VPL / NPV)
|
|
90
|
+
* @param fluxoCaixa Array de fluxos de caixa — índice 0 = t=0 (investimento inicial, geralmente negativo)
|
|
91
|
+
* @param taxa Taxa de desconto por período como decimal (ex: 0.1 = 10%)
|
|
92
|
+
* @returns VPL — positivo indica projeto viável
|
|
93
|
+
*
|
|
94
|
+
* Exemplo: VPL de -10000 hoje, +4000 nos próximos 4 anos com taxa 10%:
|
|
95
|
+
* valorPresenteLiquido([-10000, 4000, 4000, 4000, 4000], 0.10)
|
|
96
|
+
*/
|
|
97
|
+
static valorPresenteLiquido(fluxoCaixa: number[], taxa: number): number;
|
|
98
|
+
}
|
|
99
|
+
export declare const MatematicaMetodos: {
|
|
100
|
+
soma: typeof MatematicaStdlib.soma;
|
|
101
|
+
media: typeof MatematicaStdlib.media;
|
|
102
|
+
mediana: typeof MatematicaStdlib.mediana;
|
|
103
|
+
desvioPadrao: typeof MatematicaStdlib.desvioPadrao;
|
|
104
|
+
variancia: typeof MatematicaStdlib.variancia;
|
|
105
|
+
minimo: typeof MatematicaStdlib.minimo;
|
|
106
|
+
maximo: typeof MatematicaStdlib.maximo;
|
|
107
|
+
arredondar: typeof MatematicaStdlib.arredondar;
|
|
108
|
+
abs: typeof MatematicaStdlib.abs;
|
|
109
|
+
potencia: typeof MatematicaStdlib.potencia;
|
|
110
|
+
raiz: typeof MatematicaStdlib.raiz;
|
|
111
|
+
curvaABC: typeof MatematicaStdlib.curvaABC;
|
|
112
|
+
percentil: typeof MatematicaStdlib.percentil;
|
|
113
|
+
correlacao: typeof MatematicaStdlib.correlacao;
|
|
114
|
+
mediaMóvel: typeof MatematicaStdlib.mediaMóvel;
|
|
115
|
+
taxaCrescimento: typeof MatematicaStdlib.taxaCrescimento;
|
|
116
|
+
regressaoLinear: typeof MatematicaStdlib.regressaoLinear;
|
|
117
|
+
detectarOutliers: typeof MatematicaStdlib.detectarOutliers;
|
|
118
|
+
jurosCompostos: typeof MatematicaStdlib.jurosCompostos;
|
|
119
|
+
valorPresenteLiquido: typeof MatematicaStdlib.valorPresenteLiquido;
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=matematica.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matematica.d.ts","sourceRoot":"","sources":["../../stdlib/matematica.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,qBAAa,gBAAgB;IAI3B,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;IAIpC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;IAKrC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;IASvC,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;IAO5C,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;IAOzC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;IAKtC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;IAKtC,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAE,MAAU,GAAG,MAAM;IAI3D,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,GA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E,CAAC;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,GAAG,EAAE,MAAM,CAAC;QACZ,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;KACxB;IA2BD;;;;;;OAMG;IACH,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAI7E;;;;;;;;OAQG;IACH,MAAM,CAAC,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;CAIxE;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;CAqB7B,CAAC"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Biblioteca matemática e estatística para o runtime JADE
|
|
3
|
+
* Acessível via Matematica.metodo(args) no código JADE
|
|
4
|
+
*/
|
|
5
|
+
export class MatematicaStdlib {
|
|
6
|
+
// ── Básico ────────────────────────────────────────────────
|
|
7
|
+
static soma(lista) {
|
|
8
|
+
return lista.reduce((acc, v) => acc + v, 0);
|
|
9
|
+
}
|
|
10
|
+
static media(lista) {
|
|
11
|
+
if (lista.length === 0)
|
|
12
|
+
return NaN;
|
|
13
|
+
return MatematicaStdlib.soma(lista) / lista.length;
|
|
14
|
+
}
|
|
15
|
+
static mediana(lista) {
|
|
16
|
+
if (lista.length === 0)
|
|
17
|
+
return NaN;
|
|
18
|
+
const sorted = [...lista].sort((a, b) => a - b);
|
|
19
|
+
const mid = Math.floor(sorted.length / 2);
|
|
20
|
+
return sorted.length % 2 !== 0
|
|
21
|
+
? sorted[mid]
|
|
22
|
+
: (sorted[mid - 1] + sorted[mid]) / 2;
|
|
23
|
+
}
|
|
24
|
+
static desvioPadrao(lista) {
|
|
25
|
+
if (lista.length === 0)
|
|
26
|
+
return NaN;
|
|
27
|
+
const m = MatematicaStdlib.media(lista);
|
|
28
|
+
const variancia = lista.reduce((acc, v) => acc + Math.pow(v - m, 2), 0) / lista.length;
|
|
29
|
+
return Math.sqrt(variancia);
|
|
30
|
+
}
|
|
31
|
+
static variancia(lista) {
|
|
32
|
+
if (lista.length === 0)
|
|
33
|
+
return NaN;
|
|
34
|
+
const m = MatematicaStdlib.media(lista);
|
|
35
|
+
return lista.reduce((acc, v) => acc + Math.pow(v - m, 2), 0) / lista.length;
|
|
36
|
+
}
|
|
37
|
+
// reduce evita estouro de pilha com listas grandes (Math.min/max(...lista) quebra ~100k+ itens)
|
|
38
|
+
static minimo(lista) {
|
|
39
|
+
if (lista.length === 0)
|
|
40
|
+
return NaN;
|
|
41
|
+
return lista.reduce((min, v) => v < min ? v : min, lista[0]);
|
|
42
|
+
}
|
|
43
|
+
static maximo(lista) {
|
|
44
|
+
if (lista.length === 0)
|
|
45
|
+
return NaN;
|
|
46
|
+
return lista.reduce((max, v) => v > max ? v : max, lista[0]);
|
|
47
|
+
}
|
|
48
|
+
static arredondar(valor, casas = 2) {
|
|
49
|
+
return Math.round(valor * Math.pow(10, casas)) / Math.pow(10, casas);
|
|
50
|
+
}
|
|
51
|
+
static abs(valor) {
|
|
52
|
+
return Math.abs(valor);
|
|
53
|
+
}
|
|
54
|
+
static potencia(base, expoente) {
|
|
55
|
+
return Math.pow(base, expoente);
|
|
56
|
+
}
|
|
57
|
+
static raiz(valor) {
|
|
58
|
+
return Math.sqrt(valor);
|
|
59
|
+
}
|
|
60
|
+
// ── Análise estatística ───────────────────────────────────
|
|
61
|
+
/**
|
|
62
|
+
* Curva ABC (classificação de Pareto)
|
|
63
|
+
* Retorna cada item com sua classe (A, B ou C) baseado em percentual acumulado
|
|
64
|
+
* Classe A: 0–80%, Classe B: 80–95%, Classe C: 95–100%
|
|
65
|
+
*/
|
|
66
|
+
static curvaABC(itens) {
|
|
67
|
+
const total = itens.reduce((acc, i) => acc + i.valor, 0);
|
|
68
|
+
if (total === 0)
|
|
69
|
+
return [];
|
|
70
|
+
const sorted = [...itens].sort((a, b) => b.valor - a.valor);
|
|
71
|
+
let acumulado = 0;
|
|
72
|
+
return sorted.map(item => {
|
|
73
|
+
const percentual = (item.valor / total) * 100;
|
|
74
|
+
acumulado += percentual;
|
|
75
|
+
const classe = acumulado <= 80 ? 'A' : acumulado <= 95 ? 'B' : 'C';
|
|
76
|
+
return {
|
|
77
|
+
id: item.id,
|
|
78
|
+
valor: item.valor,
|
|
79
|
+
percentual: Math.round(percentual * 100) / 100,
|
|
80
|
+
acumulado: Math.round(acumulado * 100) / 100,
|
|
81
|
+
classe
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Percentil — retorna o valor no percentil p (0–100) da lista
|
|
87
|
+
*/
|
|
88
|
+
static percentil(lista, p) {
|
|
89
|
+
if (lista.length === 0)
|
|
90
|
+
return NaN;
|
|
91
|
+
const sorted = [...lista].sort((a, b) => a - b);
|
|
92
|
+
const index = (p / 100) * (sorted.length - 1);
|
|
93
|
+
const lower = Math.floor(index);
|
|
94
|
+
const upper = Math.ceil(index);
|
|
95
|
+
if (lower === upper)
|
|
96
|
+
return sorted[lower];
|
|
97
|
+
return sorted[lower] + (index - lower) * (sorted[upper] - sorted[lower]);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Correlação de Pearson entre dois conjuntos de dados
|
|
101
|
+
*/
|
|
102
|
+
static correlacao(x, y) {
|
|
103
|
+
if (x.length !== y.length || x.length === 0)
|
|
104
|
+
return NaN;
|
|
105
|
+
const mx = MatematicaStdlib.media(x);
|
|
106
|
+
const my = MatematicaStdlib.media(y);
|
|
107
|
+
const num = x.reduce((acc, xi, i) => acc + (xi - mx) * (y[i] - my), 0);
|
|
108
|
+
const denX = Math.sqrt(x.reduce((acc, xi) => acc + Math.pow(xi - mx, 2), 0));
|
|
109
|
+
const denY = Math.sqrt(y.reduce((acc, yi) => acc + Math.pow(yi - my, 2), 0));
|
|
110
|
+
if (denX === 0 || denY === 0)
|
|
111
|
+
return 0;
|
|
112
|
+
return num / (denX * denY);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Média móvel simples (SMA) — O(n) com janela deslizante
|
|
116
|
+
*/
|
|
117
|
+
static mediaMóvel(lista, janela) {
|
|
118
|
+
if (janela <= 0 || janela > lista.length)
|
|
119
|
+
return [];
|
|
120
|
+
const resultado = [];
|
|
121
|
+
// Soma inicial da primeira janela
|
|
122
|
+
let somaJanela = 0;
|
|
123
|
+
for (let i = 0; i < janela; i++)
|
|
124
|
+
somaJanela += lista[i];
|
|
125
|
+
resultado.push(somaJanela / janela);
|
|
126
|
+
// Desliza a janela: subtrai o elemento que sai, soma o que entra
|
|
127
|
+
for (let i = janela; i < lista.length; i++) {
|
|
128
|
+
somaJanela += lista[i] - lista[i - janela];
|
|
129
|
+
resultado.push(somaJanela / janela);
|
|
130
|
+
}
|
|
131
|
+
return resultado;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Taxa de crescimento percentual entre dois valores
|
|
135
|
+
*/
|
|
136
|
+
static taxaCrescimento(valorInicial, valorFinal) {
|
|
137
|
+
if (valorInicial === 0)
|
|
138
|
+
return 0;
|
|
139
|
+
return ((valorFinal - valorInicial) / Math.abs(valorInicial)) * 100;
|
|
140
|
+
}
|
|
141
|
+
// ── Análise preditiva ─────────────────────────────────────
|
|
142
|
+
/**
|
|
143
|
+
* Regressão linear simples — ajusta a reta y = a·x + b aos dados
|
|
144
|
+
* @returns { a, b, r2 }
|
|
145
|
+
* a = inclinação (tendência por período)
|
|
146
|
+
* b = intercepto (valor inicial projetado)
|
|
147
|
+
* r2 = coeficiente de determinação 0–1 (1 = ajuste perfeito)
|
|
148
|
+
*
|
|
149
|
+
* Uso típico: prever demanda futura a partir do histórico de vendas
|
|
150
|
+
* const { a, b } = Matematica.regressaoLinear(vendas)
|
|
151
|
+
* previsao = a * proximoPeriodo + b
|
|
152
|
+
*/
|
|
153
|
+
static regressaoLinear(y) {
|
|
154
|
+
const n = y.length;
|
|
155
|
+
if (n < 2)
|
|
156
|
+
return { a: NaN, b: NaN, r2: NaN };
|
|
157
|
+
// x implícito = [0, 1, 2, ..., n-1]
|
|
158
|
+
const somaX = (n * (n - 1)) / 2;
|
|
159
|
+
const somaX2 = (n * (n - 1) * (2 * n - 1)) / 6;
|
|
160
|
+
const somaY = MatematicaStdlib.soma(y);
|
|
161
|
+
const somaXY = y.reduce((acc, yi, i) => acc + i * yi, 0);
|
|
162
|
+
const den = n * somaX2 - somaX * somaX;
|
|
163
|
+
if (den === 0)
|
|
164
|
+
return { a: 0, b: somaY / n, r2: 0 };
|
|
165
|
+
const a = (n * somaXY - somaX * somaY) / den;
|
|
166
|
+
const b = (somaY - a * somaX) / n;
|
|
167
|
+
// R² = 1 - SS_res / SS_tot
|
|
168
|
+
const mediaY = somaY / n;
|
|
169
|
+
const ss_tot = y.reduce((acc, yi) => acc + Math.pow(yi - mediaY, 2), 0);
|
|
170
|
+
const ss_res = y.reduce((acc, yi, i) => acc + Math.pow(yi - (a * i + b), 2), 0);
|
|
171
|
+
const r2 = ss_tot === 0 ? 1 : 1 - ss_res / ss_tot;
|
|
172
|
+
return { a, b, r2 };
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Detecta outliers usando o método IQR (Intervalo Interquartil)
|
|
176
|
+
* Outlier: valor abaixo de Q1 − 1.5×IQR ou acima de Q3 + 1.5×IQR
|
|
177
|
+
* @returns { normais, outliers, q1, q3, iqr, limiteInferior, limiteSuperior }
|
|
178
|
+
*
|
|
179
|
+
* Uso típico: filtrar picos atípicos de venda antes de projetar estoque
|
|
180
|
+
*/
|
|
181
|
+
static detectarOutliers(lista) {
|
|
182
|
+
if (lista.length === 0) {
|
|
183
|
+
return { normais: [], outliers: [], q1: NaN, q3: NaN, iqr: NaN, limiteInferior: NaN, limiteSuperior: NaN };
|
|
184
|
+
}
|
|
185
|
+
const q1 = MatematicaStdlib.percentil(lista, 25);
|
|
186
|
+
const q3 = MatematicaStdlib.percentil(lista, 75);
|
|
187
|
+
const iqr = q3 - q1;
|
|
188
|
+
const limiteInferior = q1 - 1.5 * iqr;
|
|
189
|
+
const limiteSuperior = q3 + 1.5 * iqr;
|
|
190
|
+
const normais = [];
|
|
191
|
+
const outliers = [];
|
|
192
|
+
for (const v of lista) {
|
|
193
|
+
if (v < limiteInferior || v > limiteSuperior) {
|
|
194
|
+
outliers.push(v);
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
normais.push(v);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return { normais, outliers, q1, q3, iqr, limiteInferior, limiteSuperior };
|
|
201
|
+
}
|
|
202
|
+
// ── Matemática Financeira ─────────────────────────────────
|
|
203
|
+
/**
|
|
204
|
+
* Juros compostos — retorna o montante final
|
|
205
|
+
* @param principal Valor inicial (ex: 10000)
|
|
206
|
+
* @param taxa Taxa por período como decimal (ex: 0.12 = 12% a.a.)
|
|
207
|
+
* @param tempo Número de períodos (ex: 5 anos)
|
|
208
|
+
* @returns Montante: principal × (1 + taxa)^tempo
|
|
209
|
+
*/
|
|
210
|
+
static jurosCompostos(principal, taxa, tempo) {
|
|
211
|
+
return principal * Math.pow(1 + taxa, tempo);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Valor Presente Líquido (VPL / NPV)
|
|
215
|
+
* @param fluxoCaixa Array de fluxos de caixa — índice 0 = t=0 (investimento inicial, geralmente negativo)
|
|
216
|
+
* @param taxa Taxa de desconto por período como decimal (ex: 0.1 = 10%)
|
|
217
|
+
* @returns VPL — positivo indica projeto viável
|
|
218
|
+
*
|
|
219
|
+
* Exemplo: VPL de -10000 hoje, +4000 nos próximos 4 anos com taxa 10%:
|
|
220
|
+
* valorPresenteLiquido([-10000, 4000, 4000, 4000, 4000], 0.10)
|
|
221
|
+
*/
|
|
222
|
+
static valorPresenteLiquido(fluxoCaixa, taxa) {
|
|
223
|
+
if (fluxoCaixa.length === 0)
|
|
224
|
+
return NaN;
|
|
225
|
+
return fluxoCaixa.reduce((vpl, fc, t) => vpl + fc / Math.pow(1 + taxa, t), 0);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
export const MatematicaMetodos = {
|
|
229
|
+
soma: MatematicaStdlib.soma,
|
|
230
|
+
media: MatematicaStdlib.media,
|
|
231
|
+
mediana: MatematicaStdlib.mediana,
|
|
232
|
+
desvioPadrao: MatematicaStdlib.desvioPadrao,
|
|
233
|
+
variancia: MatematicaStdlib.variancia,
|
|
234
|
+
minimo: MatematicaStdlib.minimo,
|
|
235
|
+
maximo: MatematicaStdlib.maximo,
|
|
236
|
+
arredondar: MatematicaStdlib.arredondar,
|
|
237
|
+
abs: MatematicaStdlib.abs,
|
|
238
|
+
potencia: MatematicaStdlib.potencia,
|
|
239
|
+
raiz: MatematicaStdlib.raiz,
|
|
240
|
+
curvaABC: MatematicaStdlib.curvaABC,
|
|
241
|
+
percentil: MatematicaStdlib.percentil,
|
|
242
|
+
correlacao: MatematicaStdlib.correlacao,
|
|
243
|
+
mediaMóvel: MatematicaStdlib.mediaMóvel,
|
|
244
|
+
taxaCrescimento: MatematicaStdlib.taxaCrescimento,
|
|
245
|
+
regressaoLinear: MatematicaStdlib.regressaoLinear,
|
|
246
|
+
detectarOutliers: MatematicaStdlib.detectarOutliers,
|
|
247
|
+
jurosCompostos: MatematicaStdlib.jurosCompostos,
|
|
248
|
+
valorPresenteLiquido: MatematicaStdlib.valorPresenteLiquido,
|
|
249
|
+
};
|
|
250
|
+
//# sourceMappingURL=matematica.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matematica.js","sourceRoot":"","sources":["../../stdlib/matematica.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,OAAO,gBAAgB;IAE3B,6DAA6D;IAE7D,MAAM,CAAC,IAAI,CAAC,KAAe;QACzB,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,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|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Biblioteca monetária para o runtime JADE
|
|
3
|
+
* Acessível via Moeda.metodo(args) no código JADE
|
|
4
|
+
*
|
|
5
|
+
* Toda aritmética é feita em centavos (inteiros) para eliminar
|
|
6
|
+
* erros de ponto flutuante IEEE 754 em operações monetárias.
|
|
7
|
+
*
|
|
8
|
+
* Exemplo do problema resolvido:
|
|
9
|
+
* 0.1 + 0.2 === 0.30000000000000004 ← JavaScript puro
|
|
10
|
+
* Moeda.somar(0.1, 0.2) === 0.30 ← esta lib
|
|
11
|
+
*/
|
|
12
|
+
export declare class MoedaStdlib {
|
|
13
|
+
/**
|
|
14
|
+
* Converte reais para centavos inteiros
|
|
15
|
+
* 1234.50 → 123450
|
|
16
|
+
*/
|
|
17
|
+
static toCentavos(valor: number): number;
|
|
18
|
+
/**
|
|
19
|
+
* Converte centavos inteiros para reais
|
|
20
|
+
* 123450 → 1234.50
|
|
21
|
+
*/
|
|
22
|
+
static fromCentavos(centavos: number): number;
|
|
23
|
+
/**
|
|
24
|
+
* Formata valor como moeda brasileira
|
|
25
|
+
* 1234.5 → "R$ 1.234,50"
|
|
26
|
+
* -500 → "-R$ 500,00"
|
|
27
|
+
* 0 → "R$ 0,00"
|
|
28
|
+
*/
|
|
29
|
+
static formatarBRL(valor: number): string;
|
|
30
|
+
/**
|
|
31
|
+
* Formata valor em formato compacto para dashboards
|
|
32
|
+
* 1_500_000 → "R$ 1,5mi"
|
|
33
|
+
* 45_000 → "R$ 45mil"
|
|
34
|
+
* 1_500 → "R$ 1,5mil"
|
|
35
|
+
* 500 → "R$ 500,00"
|
|
36
|
+
*/
|
|
37
|
+
static formatarCompacto(valor: number): string;
|
|
38
|
+
private static _compactarNumero;
|
|
39
|
+
/**
|
|
40
|
+
* Converte texto de moeda brasileira para número
|
|
41
|
+
* "R$ 1.234,50" → 1234.50
|
|
42
|
+
* "1.234,50" → 1234.50
|
|
43
|
+
* "1234,50" → 1234.50
|
|
44
|
+
* "-R$ 500,00" → -500.00
|
|
45
|
+
* Retorna NaN se o formato não for reconhecido
|
|
46
|
+
*/
|
|
47
|
+
static parseBRL(texto: string): number;
|
|
48
|
+
/**
|
|
49
|
+
* Soma monetária sem erro de ponto flutuante
|
|
50
|
+
* somar(0.1, 0.2) === 0.30 (não 0.30000000000000004)
|
|
51
|
+
*/
|
|
52
|
+
static somar(a: number, b: number): number;
|
|
53
|
+
/**
|
|
54
|
+
* Subtração monetária sem erro de ponto flutuante
|
|
55
|
+
*/
|
|
56
|
+
static subtrair(a: number, b: number): number;
|
|
57
|
+
/**
|
|
58
|
+
* Multiplica um valor monetário por um fator (ex: preço × quantidade)
|
|
59
|
+
* O fator pode ser decimal (ex: 1.5 unidades)
|
|
60
|
+
*/
|
|
61
|
+
static multiplicar(valor: number, fator: number): number;
|
|
62
|
+
/**
|
|
63
|
+
* Divide um valor monetário por um divisor
|
|
64
|
+
* Arredonda para centavos (sem distribuição do resto — veja distribuir())
|
|
65
|
+
*/
|
|
66
|
+
static dividir(valor: number, divisor: number): number;
|
|
67
|
+
/**
|
|
68
|
+
* Compara dois valores monetários com precisão de centavos
|
|
69
|
+
* Evita problemas de 0.1 + 0.2 !== 0.3
|
|
70
|
+
*/
|
|
71
|
+
static igual(a: number, b: number): boolean;
|
|
72
|
+
static maior(a: number, b: number): boolean;
|
|
73
|
+
static menor(a: number, b: number): boolean;
|
|
74
|
+
static maiorOuIgual(a: number, b: number): boolean;
|
|
75
|
+
static menorOuIgual(a: number, b: number): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Aplica desconto percentual sobre um valor
|
|
78
|
+
* descontar(100, 10) → 90.00 (10% de desconto)
|
|
79
|
+
*/
|
|
80
|
+
static descontar(valor: number, percentual: number): number;
|
|
81
|
+
/**
|
|
82
|
+
* Acrescenta percentual sobre um valor
|
|
83
|
+
* acrescentar(100, 10) → 110.00 (10% de acréscimo)
|
|
84
|
+
*/
|
|
85
|
+
static acrescentar(valor: number, percentual: number): number;
|
|
86
|
+
/**
|
|
87
|
+
* Calcula o valor de um percentual sobre um montante
|
|
88
|
+
* porcentagem(200, 15) → 30.00 (15% de R$200)
|
|
89
|
+
*/
|
|
90
|
+
static porcentagem(valor: number, percentual: number): number;
|
|
91
|
+
/**
|
|
92
|
+
* Distribui um valor em N partes iguais, resolvendo o problema do centavo
|
|
93
|
+
* Os centavos restantes são distribuídos nas primeiras parcelas
|
|
94
|
+
*
|
|
95
|
+
* distribuir(10, 3) → [3.34, 3.33, 3.33] (não [3.33, 3.33, 3.33] = 9.99)
|
|
96
|
+
* distribuir(100, 4) → [25, 25, 25, 25]
|
|
97
|
+
*/
|
|
98
|
+
static distribuir(total: number, partes: number): number[];
|
|
99
|
+
/**
|
|
100
|
+
* Calcula valor total de uma lista de itens (quantidade × preço unitário)
|
|
101
|
+
* Seguro contra ponto flutuante
|
|
102
|
+
*/
|
|
103
|
+
static totalItens(itens: {
|
|
104
|
+
quantidade: number;
|
|
105
|
+
precoUnitario: number;
|
|
106
|
+
}[]): number;
|
|
107
|
+
}
|
|
108
|
+
export declare const MoedaMetodos: {
|
|
109
|
+
toCentavos: typeof MoedaStdlib.toCentavos;
|
|
110
|
+
fromCentavos: typeof MoedaStdlib.fromCentavos;
|
|
111
|
+
formatarBRL: typeof MoedaStdlib.formatarBRL;
|
|
112
|
+
formatarCompacto: typeof MoedaStdlib.formatarCompacto;
|
|
113
|
+
parseBRL: typeof MoedaStdlib.parseBRL;
|
|
114
|
+
somar: typeof MoedaStdlib.somar;
|
|
115
|
+
subtrair: typeof MoedaStdlib.subtrair;
|
|
116
|
+
multiplicar: typeof MoedaStdlib.multiplicar;
|
|
117
|
+
dividir: typeof MoedaStdlib.dividir;
|
|
118
|
+
igual: typeof MoedaStdlib.igual;
|
|
119
|
+
maior: typeof MoedaStdlib.maior;
|
|
120
|
+
menor: typeof MoedaStdlib.menor;
|
|
121
|
+
maiorOuIgual: typeof MoedaStdlib.maiorOuIgual;
|
|
122
|
+
menorOuIgual: typeof MoedaStdlib.menorOuIgual;
|
|
123
|
+
descontar: typeof MoedaStdlib.descontar;
|
|
124
|
+
acrescentar: typeof MoedaStdlib.acrescentar;
|
|
125
|
+
porcentagem: typeof MoedaStdlib.porcentagem;
|
|
126
|
+
distribuir: typeof MoedaStdlib.distribuir;
|
|
127
|
+
totalItens: typeof MoedaStdlib.totalItens;
|
|
128
|
+
};
|
|
129
|
+
//# sourceMappingURL=moeda.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moeda.d.ts","sourceRoot":"","sources":["../../stdlib/moeda.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,qBAAa,WAAW;IAItB;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIxC;;;OAGG;IACH,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAM7C;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAUzC;;;;;;OAMG;IACH,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAkB9C,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAU/B;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAetC;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAM1C;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAM7C;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAMxD;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAA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