Skip to content

Commit daa6315

Browse files
author
Luke Brandon Farrell
committed
fix(code): added lib folder so library can be correctly resolved
1 parent 9997806 commit daa6315

File tree

5 files changed

+48
-1
lines changed

5 files changed

+48
-1
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
node_modules
2-
/lib
32
.vscode

lib/custom-alert.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* @author Sagar Raja Shakya
3+
* @description Setup the custom alerts
4+
*/
5+
import { AlertButton, AlertOptions } from 'react-native';
6+
interface AlertParams {
7+
title: string;
8+
message?: string;
9+
buttons?: AlertButton[];
10+
options?: AlertOptions;
11+
}
12+
interface AlertName {
13+
[key: string]: AlertParams;
14+
}
15+
declare class CustomAlert {
16+
static alerts: AlertName;
17+
static setup(name: string, title: string, message?: string, buttons?: AlertButton[], options?: AlertOptions): void;
18+
static alert(name: string): void;
19+
}
20+
export default CustomAlert;

lib/custom-alert.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"use strict";
2+
/**
3+
* @author Sagar Raja Shakya
4+
* @description Setup the custom alerts
5+
*/
6+
Object.defineProperty(exports, "__esModule", { value: true });
7+
/* NPM - Node Package Manage */
8+
var react_native_1 = require("react-native");
9+
var CustomAlert = /** @class */ (function () {
10+
function CustomAlert() {
11+
}
12+
CustomAlert.setup = function (name, title, message, buttons, options) {
13+
CustomAlert.alerts[name] = { title: title, message: message, buttons: buttons, options: options };
14+
};
15+
CustomAlert.alert = function (name) {
16+
var _a = CustomAlert.alerts[name], title = _a.title, message = _a.message, buttons = _a.buttons, options = _a.options;
17+
react_native_1.Alert.alert(title, message, buttons, options);
18+
};
19+
CustomAlert.alerts = {};
20+
return CustomAlert;
21+
}());
22+
exports.default = CustomAlert;

lib/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as CustomAlert } from './custom-alert';

lib/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
exports.CustomAlert = void 0;
4+
var custom_alert_1 = require("./custom-alert");
5+
Object.defineProperty(exports, "CustomAlert", { enumerable: true, get: function () { return custom_alert_1.default; } });

0 commit comments

Comments
 (0)